aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/controller.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2013-02-23 21:59:25 +1300
committerAldo Cortesi <aldo@nullcube.com>2013-02-23 21:59:25 +1300
commit05e4d4468ec372adb73649e6980c525a185e9c07 (patch)
tree158727e939713e7e5378362502699f886b40bc10 /libmproxy/controller.py
parent269780c57780d155c4d8bd95fcc2af2104effa5b (diff)
downloadmitmproxy-05e4d4468ec372adb73649e6980c525a185e9c07.tar.gz
mitmproxy-05e4d4468ec372adb73649e6980c525a185e9c07.tar.bz2
mitmproxy-05e4d4468ec372adb73649e6980c525a185e9c07.zip
Test request and response kill functionality.
Diffstat (limited to 'libmproxy/controller.py')
-rw-r--r--libmproxy/controller.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/libmproxy/controller.py b/libmproxy/controller.py
index da097692..bb22597d 100644
--- a/libmproxy/controller.py
+++ b/libmproxy/controller.py
@@ -41,10 +41,13 @@ class Reply:
self.q = Queue.Queue()
self.acked = False
- def __call__(self, msg=False):
+ def __call__(self, msg=None):
if not self.acked:
self.acked = True
- self.q.put(msg or self.obj)
+ if msg is None:
+ self.q.put(self.obj)
+ else:
+ self.q.put(msg)
class Channel:
@@ -62,7 +65,7 @@ class Channel:
try:
# The timeout is here so we can handle a should_exit event.
g = m.reply.q.get(timeout=0.5)
- except Queue.Empty:
+ except Queue.Empty: # pragma: nocover
continue
return g