aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/controller.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2011-02-06 18:44:35 +1300
committerAldo Cortesi <aldo@nullcube.com>2011-02-06 18:44:35 +1300
commiteb15ef7b80434b857aae33256851a3202d13e429 (patch)
tree762db04676843406fc2418b9615ac72b0357b745 /libmproxy/controller.py
parenta4eaafab5a003298c8235f7502fb684da2220ca8 (diff)
parentb35cbc076058bf199ba0fd3db5be48dcccbf86f0 (diff)
downloadmitmproxy-eb15ef7b80434b857aae33256851a3202d13e429.tar.gz
mitmproxy-eb15ef7b80434b857aae33256851a3202d13e429.tar.bz2
mitmproxy-eb15ef7b80434b857aae33256851a3202d13e429.zip
Merge remote branch 'hno/master'
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 ddfbe7f1..468092b7 100644
--- a/libmproxy/controller.py
+++ b/libmproxy/controller.py
@@ -23,15 +23,18 @@ class Msg:
self.q = Queue.Queue()
self.acked = False
- def ack(self, data=None):
+ def ack(self, data=False):
self.acked = True
- self.q.put(data or self)
+ if data is None:
+ self.q.put(data)
+ else:
+ self.q.put(data or self)
def send(self, masterq):
self.acked = False
try:
masterq.put(self, timeout=3)
- return self.q.get(timeout=3)
+ return self.q.get()
except (Queue.Empty, Queue.Full):
return None