From 7b84848be24db969e62d33837269c9abe45bfb31 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sat, 23 Apr 2022 12:48:34 +0200 Subject: [PATCH] fix save addon memory leak introduced by copying the also-broken `request()` implementation. 7004d694b73d0ea3031012e6071706fbc5ad88c7 will fix it there next week. --- mitmproxy/addons/save.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mitmproxy/addons/save.py b/mitmproxy/addons/save.py index e1d7b7522..9b5d41727 100644 --- a/mitmproxy/addons/save.py +++ b/mitmproxy/addons/save.py @@ -138,8 +138,7 @@ class Save: self.active_flows.add(flow) def tcp_end(self, flow: tcp.TCPFlow): - if self.stream: - self.save_flow(flow) + self.save_flow(flow) def tcp_error(self, flow: tcp.TCPFlow): self.tcp_end(flow) @@ -160,7 +159,8 @@ class Save: self.response(flow) def dns_request(self, flow: dns.DNSFlow): - self.active_flows.add(flow) + if self.stream: + self.active_flows.add(flow) def dns_response(self, flow: dns.DNSFlow): self.save_flow(flow)