diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-07-09 10:22:14 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-07-09 10:22:14 +1200 |
commit | bbd9acf55123edd67d0b8033c3bd54b8e0a2c6cf (patch) | |
tree | 45a71b59a098161e569ef46bcaae325961bd17e6 /libmproxy/console | |
parent | 572e8a49629a889129527285e8e2f339fe72df35 (diff) | |
download | mitmproxy-bbd9acf55123edd67d0b8033c3bd54b8e0a2c6cf.tar.gz mitmproxy-bbd9acf55123edd67d0b8033c3bd54b8e0a2c6cf.tar.bz2 mitmproxy-bbd9acf55123edd67d0b8033c3bd54b8e0a2c6cf.zip |
Use FlowMaster streaming for "W" in mitmproxy.
Diffstat (limited to 'libmproxy/console')
-rw-r--r-- | libmproxy/console/__init__.py | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/libmproxy/console/__init__.py b/libmproxy/console/__init__.py index 4034c188..f770531a 100644 --- a/libmproxy/console/__init__.py +++ b/libmproxy/console/__init__.py @@ -354,7 +354,7 @@ class ConsoleMaster(flow.FlowMaster): def __init__(self, server, options): flow.FlowMaster.__init__(self, server, ConsoleState()) self.looptime = 0 - self.stream = None + self.stream_path = None self.options = options for i in options.replacements: @@ -412,15 +412,11 @@ class ConsoleMaster(flow.FlowMaster): path = os.path.expanduser(path) try: f = file(path, "ab") - self.stream = flow.FlowWriter(f) + flow.FlowMaster.start_stream(self, f) except IOError, v: return str(v) self.stream_path = path - def stop_stream(self): - self.stream = None - self.stream_path = None - def run_script_once(self, path, f): if not path: return @@ -926,8 +922,6 @@ class ConsoleMaster(flow.FlowMaster): def shutdown(self): self.state.killall(self) - if self.stream: - self.stream.fo.close() flow.FlowMaster.shutdown(self) def sync_list_view(self): @@ -992,6 +986,4 @@ class ConsoleMaster(flow.FlowMaster): f = flow.FlowMaster.handle_response(self, r) if f: self.process_flow(f, r) - if self.stream: - self.stream.add(f) return f |