Skip to content

Commit

Permalink
Merge pull request mitmproxy#744 from Kriechi/proxy-refactor-cb
Browse files Browse the repository at this point in the history
do not log WindowUpdateFrame frames
  • Loading branch information
mhils committed Aug 31, 2015
2 parents 481cc6e + c4d6b35 commit de10b3f
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 de10b3f

Please sign in to comment.