diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2016-10-04 16:50:09 +1100 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2016-10-04 16:52:58 +1100 |
commit | e18965268075bb440afb42afff7c2246bc6c7e3b (patch) | |
tree | b58a1e9d2a572271a02b28b2f5e86ff0754a04f1 /mitmproxy/dump.py | |
parent | 882c363ec57792b00ebf1f731ec5c5e4bd24d58d (diff) | |
download | mitmproxy-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.py | 9 |
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() |