diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-08-20 20:36:51 +0200 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-08-20 20:36:51 +0200 |
commit | 53f2582313ce5e8d1c875bea8b3f1a270db35b5b (patch) | |
tree | bc3cf46f2a91cca227a82aee4f4f54c4dfcbace1 /netlib/http/http2/protocol.py | |
parent | 16f697f68a7f94375bd1435f5eec6e00911b7019 (diff) | |
download | mitmproxy-53f2582313ce5e8d1c875bea8b3f1a270db35b5b.tar.gz mitmproxy-53f2582313ce5e8d1c875bea8b3f1a270db35b5b.tar.bz2 mitmproxy-53f2582313ce5e8d1c875bea8b3f1a270db35b5b.zip |
http2: fix unhandled settings frame
Diffstat (limited to 'netlib/http/http2/protocol.py')
-rw-r--r-- | netlib/http/http2/protocol.py | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/netlib/http/http2/protocol.py b/netlib/http/http2/protocol.py index cf46a130..66ce19c8 100644 --- a/netlib/http/http2/protocol.py +++ b/netlib/http/http2/protocol.py @@ -239,7 +239,8 @@ class HTTP2Protocol(semantics.ProtocolMixin): self.tcp_handler.wfile.write(self.CLIENT_CONNECTION_PREFACE) self.send_frame(frame.SettingsFrame(state=self), hide=True) - self._receive_settings(hide=True) + self._receive_settings(hide=True) # server announces own settings + self._receive_settings(hide=True) # server acks my settings def send_frame(self, frm, hide=False): raw_bytes = frm.to_bytes() @@ -279,16 +280,6 @@ class HTTP2Protocol(semantics.ProtocolMixin): else: self._handle_unexpected_frame(frm) - def _read_settings_ack(self, hide=False): # pragma no cover - while True: - frm = self.read_frame(hide) - if isinstance(frm, frame.SettingsFrame): - assert frm.flags & frame.Frame.FLAG_ACK - assert len(frm.settings) == 0 - break - else: - self._handle_unexpected_frame(frm) - def _next_stream_id(self): if self.current_stream_id is None: if self.is_server: @@ -313,9 +304,6 @@ class HTTP2Protocol(semantics.ProtocolMixin): flags=frame.Frame.FLAG_ACK) self.send_frame(frm, hide) - # be liberal in what we expect from the other end - # to be more strict use: self._read_settings_ack(hide) - def _update_flow_control_window(self, stream_id, increment): frm = frame.WindowUpdateFrame(stream_id=0, window_size_increment=increment) self.send_frame(frm) |