From 53fadd05f4e015657cf8815d9dedc6486a4b3f02 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sat, 7 Feb 2015 16:26:19 +0100 Subject: fix #451 --- libmproxy/script.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'libmproxy/script.py') diff --git a/libmproxy/script.py b/libmproxy/script.py index b559615b..9cf402b7 100644 --- a/libmproxy/script.py +++ b/libmproxy/script.py @@ -36,7 +36,7 @@ class ScriptContext: Replay the request on the current flow. The response will be added to the flow object. """ - self._master.replay_request(f) + return self._master.replay_request(f, block=True, run_scripthooks=False) @property def app_registry(self): @@ -139,8 +139,12 @@ def _handle_concurrent_reply(fn, o, *args, **kwargs): def run(): fn(*args, **kwargs) - o.reply() # If the script did not call .reply(), we have to do it now. - threading.Thread(target=run, name="ScriptThread").start() + reply_proxy() # If the script did not call .reply(), we have to do it now. + ScriptThread(target=run).start() + + +class ScriptThread(threading.Thread): + name = "ScriptThread" def concurrent(fn): -- cgit v1.2.3