aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/controller.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2014-09-14 11:30:00 +1200
committerAldo Cortesi <aldo@nullcube.com>2014-09-14 11:30:00 +1200
commit81e3a6e8e661b212bf45fb37623556f2793d2184 (patch)
treef0fdb3d88bce83263fa91b5a0000093f335d865f /libmproxy/controller.py
parent7b74d207f39e642e5029a4855da47314ce224a33 (diff)
downloadmitmproxy-81e3a6e8e661b212bf45fb37623556f2793d2184.tar.gz
mitmproxy-81e3a6e8e661b212bf45fb37623556f2793d2184.tar.bz2
mitmproxy-81e3a6e8e661b212bf45fb37623556f2793d2184.zip
Super-basic outline for web io loop
Diffstat (limited to 'libmproxy/controller.py')
-rw-r--r--libmproxy/controller.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/libmproxy/controller.py b/libmproxy/controller.py
index 4a72cf80..c71088cb 100644
--- a/libmproxy/controller.py
+++ b/libmproxy/controller.py
@@ -89,7 +89,7 @@ class Master:
self.masterq = Queue.Queue()
self.should_exit = threading.Event()
- def tick(self, q):
+ def tick(self, q, timeout):
changed = False
try:
# This endless loop runs until the 'Queue.Empty'
@@ -97,8 +97,7 @@ class Master:
# the queue, this speeds up every request by 0.1 seconds,
# because get_input(..) function is not blocking.
while True:
- # Small timeout to prevent pegging the CPU
- msg = q.get(timeout=0.01)
+ msg = q.get(timeout=timeout)
self.handle(*msg)
changed = True
except Queue.Empty: