aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/dump.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2016-10-04 16:50:09 +1100
committerAldo Cortesi <aldo@nullcube.com>2016-10-04 16:52:58 +1100
commite18965268075bb440afb42afff7c2246bc6c7e3b (patch)
treeb58a1e9d2a572271a02b28b2f5e86ff0754a04f1 /mitmproxy/dump.py
parent882c363ec57792b00ebf1f731ec5c5e4bd24d58d (diff)
downloadmitmproxy-e18965268075bb440afb42afff7c2246bc6c7e3b.tar.gz
mitmproxy-e18965268075bb440afb42afff7c2246bc6c7e3b.tar.bz2
mitmproxy-e18965268075bb440afb42afff7c2246bc6c7e3b.zip
mitmdump: use a dummy state object
Most of the mitmdump memory leak turns out to be due to our leaky handling of the state object. Since mitmdump doesn't actually use the state object, we can replace it with a shell.
Diffstat (limited to 'mitmproxy/dump.py')
-rw-r--r--mitmproxy/dump.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/mitmproxy/dump.py b/mitmproxy/dump.py
index 0e942eac..92dce37b 100644
--- a/mitmproxy/dump.py
+++ b/mitmproxy/dump.py
@@ -35,7 +35,7 @@ class Options(options.Options):
class DumpMaster(flow.FlowMaster):
def __init__(self, server, options):
- flow.FlowMaster.__init__(self, options, server, flow.State())
+ flow.FlowMaster.__init__(self, options, server, flow.DummyState())
self.has_errored = False
self.addons.add(*builtins.default_addons())
self.addons.add(dumper.Dumper())
@@ -82,13 +82,6 @@ class DumpMaster(flow.FlowMaster):
if e.level == "error":
self.has_errored = True
- @controller.handler
- def request(self, f):
- f = super(DumpMaster, self).request(f)
- if f:
- self.state.delete_flow(f)
- return f
-
def run(self): # pragma: no cover
if self.options.rfile and not self.options.keepserving:
self.addons.done()