aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/optmanager.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2017-07-31 00:04:46 +0200
committerMaximilian Hils <git@maximilianhils.com>2017-07-31 01:58:31 +0200
commit1b09002edc984d4ead3cce118ed583c3ceca0b99 (patch)
treeeb83c1bec226b12a33313b537715179c92e6689e /mitmproxy/optmanager.py
parent826513ef278739b51d4d25eefef0ab6217df74ab (diff)
downloadmitmproxy-1b09002edc984d4ead3cce118ed583c3ceca0b99.tar.gz
mitmproxy-1b09002edc984d4ead3cce118ed583c3ceca0b99.tar.bz2
mitmproxy-1b09002edc984d4ead3cce118ed583c3ceca0b99.zip
remove OptManager._processed
Instead of having the core addon do postprocessing on body_size_limit, we add a cache to the parsing function. First, this avoids any potential issues with options and _processed getting out of sync. As anecdotal evidence, the previous implementation did not clear _processed when body_size_limit was reset to None. Second, it achieves the same end result without introducing a new concept of a "_processed" scratch space. Third, it works even if addons aren't present, and does not require workarounds as previously present in test_http2.py. refs https://github.com/mitmproxy/mitmproxy/pull/2484#pullrequestreview-53101507
Diffstat (limited to 'mitmproxy/optmanager.py')
-rw-r--r--mitmproxy/optmanager.py1
1 files changed, 0 insertions, 1 deletions
diff --git a/mitmproxy/optmanager.py b/mitmproxy/optmanager.py
index c28ec685..60130175 100644
--- a/mitmproxy/optmanager.py
+++ b/mitmproxy/optmanager.py
@@ -94,7 +94,6 @@ class OptManager:
self.__dict__["_options"] = {}
self.__dict__["changed"] = blinker.Signal()
self.__dict__["errored"] = blinker.Signal()
- self.__dict__["_processed"] = {}
def add_option(
self,