mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-30 03:14:22 +00:00
do not log WindowUpdateFrame frames
This commit is contained in:
parent
481cc6ea84
commit
c4d6b35726
@ -7,6 +7,7 @@ from netlib import odict
|
|||||||
from netlib.tcp import NetLibError, Address
|
from netlib.tcp import NetLibError, Address
|
||||||
from netlib.http.http1 import HTTP1Protocol
|
from netlib.http.http1 import HTTP1Protocol
|
||||||
from netlib.http.http2 import HTTP2Protocol
|
from netlib.http.http2 import HTTP2Protocol
|
||||||
|
from netlib.http.http2.frame import WindowUpdateFrame
|
||||||
|
|
||||||
from .. import utils
|
from .. import utils
|
||||||
from ..exceptions import InvalidCredentials, HttpException, ProtocolException
|
from ..exceptions import InvalidCredentials, HttpException, ProtocolException
|
||||||
@ -187,8 +188,15 @@ class Http2Layer(_HttpLayer):
|
|||||||
layer = HttpLayer(self, self.mode)
|
layer = HttpLayer(self, self.mode)
|
||||||
layer()
|
layer()
|
||||||
|
|
||||||
def handle_unexpected_frame(self, frm):
|
def handle_unexpected_frame(self, frame):
|
||||||
self.log("Unexpected HTTP2 Frame: %s" % frm.human_readable(), "info")
|
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):
|
class ConnectServerConnection(object):
|
||||||
|
Loading…
Reference in New Issue
Block a user