From 05e4d4468ec372adb73649e6980c525a185e9c07 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sat, 23 Feb 2013 21:59:25 +1300 Subject: Test request and response kill functionality. --- libmproxy/controller.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libmproxy/controller.py') 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 -- cgit v1.2.3