aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/protocol/http_replay.py
diff options
context:
space:
mode:
Diffstat (limited to 'mitmproxy/protocol/http_replay.py')
-rw-r--r--mitmproxy/protocol/http_replay.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/mitmproxy/protocol/http_replay.py b/mitmproxy/protocol/http_replay.py
index 62f842ce..e78af074 100644
--- a/mitmproxy/protocol/http_replay.py
+++ b/mitmproxy/protocol/http_replay.py
@@ -7,8 +7,7 @@ from netlib.http import http1
from ..controller import Channel
from ..models import Error, HTTPResponse, ServerConnection, make_connect_request
-from .base import Kill
-
+from ..exceptions import Kill
# TODO: Doesn't really belong into mitmproxy.protocol...
@@ -16,14 +15,14 @@ from .base import Kill
class RequestReplayThread(threading.Thread):
name = "RequestReplayThread"
- def __init__(self, config, flow, masterq, should_exit):
+ def __init__(self, config, flow, event_queue, should_exit):
"""
- masterqueue can be a queue or None, if no scripthooks should be
+ event_queue can be a queue or None, if no scripthooks should be
processed.
"""
self.config, self.flow = config, flow
- if masterq:
- self.channel = Channel(masterq, should_exit)
+ if event_queue:
+ self.channel = Channel(event_queue, should_exit)
else:
self.channel = None
super(RequestReplayThread, self).__init__()
@@ -37,9 +36,7 @@ class RequestReplayThread(threading.Thread):
# If we have a channel, run script hooks.
if self.channel:
request_reply = self.channel.ask("request", self.flow)
- if request_reply == Kill:
- raise Kill()
- elif isinstance(request_reply, HTTPResponse):
+ if isinstance(request_reply, HTTPResponse):
self.flow.response = request_reply
if not self.flow.response: