Skip to content

Commit

Permalink
Merge branch 'proxy-refactor-cb' of https://github.com/mitmproxy/mitm…
Browse files Browse the repository at this point in the history
…proxy into proxy-refactor-cb
  • Loading branch information
mhils committed Sep 1, 2015
2 parents b5f1c38 + de10b3f commit 6719aa5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions libmproxy/protocol/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
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
Expand Down Expand Up @@ -187,8 +188,15 @@ def __call__(self):
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):
Expand Down

0 comments on commit 6719aa5

Please sign in to comment.