aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2015-09-03 13:40:35 +0200
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2015-09-03 13:40:35 +0200
commitbde4bdd1d2182ef81db8cea1fd6baab014f96bb8 (patch)
treef0bc62a128882da2e4654b6ff5b1d387c38d7169 /libmproxy
parenta0f3803233782cb6d8e780d56e36d824b69dd5e3 (diff)
downloadmitmproxy-bde4bdd1d2182ef81db8cea1fd6baab014f96bb8.tar.gz
mitmproxy-bde4bdd1d2182ef81db8cea1fd6baab014f96bb8.tar.bz2
mitmproxy-bde4bdd1d2182ef81db8cea1fd6baab014f96bb8.zip
http2: fix unhandled frames
Diffstat (limited to 'libmproxy')
-rw-r--r--libmproxy/protocol/http.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py
index bf9abc90..5e4656b1 100644
--- a/libmproxy/protocol/http.py
+++ b/libmproxy/protocol/http.py
@@ -7,7 +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 Frame, GoAwayFrame, PriorityFrame, WindowUpdateFrame
+from netlib.http.http2.frame import Frame, PingFrame, GoAwayFrame, PriorityFrame, WindowUpdateFrame
from .. import utils
from ..exceptions import InvalidCredentials, HttpException, ProtocolException
@@ -193,6 +193,13 @@ class Http2Layer(_HttpLayer):
self.client_conn.send(GoAwayFrame().to_bytes())
def handle_unexpected_frame_from_client(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
if isinstance(frame, PriorityFrame):
# Clients are sending Priority frames depending on their implementation.
# The RFC does not clearly state when or which priority preferences should be set.
@@ -207,13 +214,6 @@ class Http2Layer(_HttpLayer):
self.log("Unexpected HTTP2 Frame: %s" % frame.human_readable(), "info")
def handle_unexpected_frame_from_server(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
if isinstance(frame, GoAwayFrame):
# Server wants to terminate the connection,
# relay it to the client.