aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/controller.py
diff options
context:
space:
mode:
Diffstat (limited to 'libmproxy/controller.py')
-rw-r--r--libmproxy/controller.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/libmproxy/controller.py b/libmproxy/controller.py
index f0e65e7f..337f379d 100644
--- a/libmproxy/controller.py
+++ b/libmproxy/controller.py
@@ -58,6 +58,9 @@ class Slave(threading.Thread):
class Master:
def __init__(self, server):
+ """
+ server may be None if no server is needed.
+ """
self.server = server
self.masterq = Queue.Queue()
@@ -75,8 +78,9 @@ class Master:
pass
def run(self):
- slave = Slave(self.masterq, self.server)
- slave.start()
+ if self.server:
+ slave = Slave(self.masterq, self.server)
+ slave.start()
while not exit:
self.tick(self.masterq)
self.shutdown()