aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/protocol/http.py
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2015-09-03 14:09:59 +0200
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2015-09-03 14:09:59 +0200
commit1f6d05f89fada5fe360aa79abfa80a3c91ce54da (patch)
tree3b25645e26007826e479e3f2f196f68389e8f480 /libmproxy/protocol/http.py
parentbc93600a66b50d06a7a3a17ee689c5899b61b975 (diff)
downloadmitmproxy-1f6d05f89fada5fe360aa79abfa80a3c91ce54da.tar.gz
mitmproxy-1f6d05f89fada5fe360aa79abfa80a3c91ce54da.tar.bz2
mitmproxy-1f6d05f89fada5fe360aa79abfa80a3c91ce54da.zip
http2: server can send WindowUpdate frames as well
Diffstat (limited to 'libmproxy/protocol/http.py')
-rw-r--r--libmproxy/protocol/http.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py
index 222af45f..dbf46973 100644
--- a/libmproxy/protocol/http.py
+++ b/libmproxy/protocol/http.py
@@ -246,9 +246,16 @@ class Http2Layer(_HttpLayer):
# respond with pong
self.server_conn.send(PingFrame(flags=Frame.FLAG_ACK, payload=frame.payload).to_bytes())
return
- self.log("Unexpected HTTP2 Frame: %s" % frame.human_readable(), "info")
+ self.log("Unexpected HTTP2 frame from client: %s" % frame.human_readable(), "info")
def handle_unexpected_frame_from_server(self, frame):
+ if isinstance(frame, WindowUpdateFrame):
+ # Servers 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.
@@ -258,7 +265,7 @@ class Http2Layer(_HttpLayer):
# respond with pong
self.client_conn.send(PingFrame(flags=Frame.FLAG_ACK, payload=frame.payload).to_bytes())
return
- self.log("Unexpected HTTP2 Frame: %s" % frame.human_readable(), "info")
+ self.log("Unexpected HTTP2 frame from server: %s" % frame.human_readable(), "info")
class ConnectServerConnection(object):