diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-09-01 02:39:57 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-09-01 02:39:57 +0200 |
commit | 6719aa5986159b8f8823a629d0692baefcce5e5b (patch) | |
tree | 49a7f826667609a1ce263b4f4d7f1956b28df50f /libmproxy/protocol/http.py | |
parent | b5f1c38e78e6711240e9805798456bb3930ef864 (diff) | |
parent | de10b3f7ecc663a5a112d65aee6f8eafd195b827 (diff) | |
download | mitmproxy-6719aa5986159b8f8823a629d0692baefcce5e5b.tar.gz mitmproxy-6719aa5986159b8f8823a629d0692baefcce5e5b.tar.bz2 mitmproxy-6719aa5986159b8f8823a629d0692baefcce5e5b.zip |
Merge branch 'proxy-refactor-cb' of https://github.com/mitmproxy/mitmproxy into proxy-refactor-cb
Diffstat (limited to 'libmproxy/protocol/http.py')
-rw-r--r-- | libmproxy/protocol/http.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py index f0f4ac24..7f57d17c 100644 --- a/libmproxy/protocol/http.py +++ b/libmproxy/protocol/http.py @@ -7,6 +7,7 @@ from netlib import odict from netlib.tcp import NetLibError, Address from netlib.http.http1 import HTTP1Protocol from netlib.http.http2 import HTTP2Protocol +from netlib.http.http2.frame import WindowUpdateFrame from .. import utils from ..exceptions import InvalidCredentials, HttpException, ProtocolException @@ -187,8 +188,15 @@ class Http2Layer(_HttpLayer): layer = HttpLayer(self, self.mode) layer() - def handle_unexpected_frame(self, frm): - self.log("Unexpected HTTP2 Frame: %s" % frm.human_readable(), "info") + def handle_unexpected_frame(self, frame): + if isinstance(frame, WindowUpdateFrame): + # Clients are sending WindowUpdate frames depending on their flow control algorithm. + # Since we cannot predict these frames, and we do not need to respond to them, + # simply accept them, and hide them from the log. + # Ideally we should keep track of our own flow control window and + # stall transmission if the outgoing flow control buffer is full. + return + self.log("Unexpected HTTP2 Frame: %s" % frame.human_readable(), "info") class ConnectServerConnection(object): |