mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-30 03:14:22 +00:00
http2: cleanup
This commit is contained in:
parent
0cc695407d
commit
8f4baf42ea
@ -573,6 +573,9 @@ class Http2SingleStreamLayer(http._HttpTransmissionLayer, basethread.BaseThread)
|
|||||||
chunks
|
chunks
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def __call__(self):
|
||||||
|
raise EnvironmentError('Http2SingleStreamLayer must be run as thread')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
layer = http.HttpLayer(self, self.mode)
|
layer = http.HttpLayer(self, self.mode)
|
||||||
|
|
||||||
|
@ -849,15 +849,15 @@ class TestMaxConcurrentStreams(_Http2Test):
|
|||||||
def test_max_concurrent_streams(self):
|
def test_max_concurrent_streams(self):
|
||||||
client, h2_conn = self._setup_connection()
|
client, h2_conn = self._setup_connection()
|
||||||
new_streams = [1, 3, 5, 7, 9, 11]
|
new_streams = [1, 3, 5, 7, 9, 11]
|
||||||
for id in new_streams:
|
for stream_id in new_streams:
|
||||||
# this will exceed MAX_CONCURRENT_STREAMS on the server connection
|
# this will exceed MAX_CONCURRENT_STREAMS on the server connection
|
||||||
# and cause mitmproxy to throttle stream creation to the server
|
# and cause mitmproxy to throttle stream creation to the server
|
||||||
self._send_request(client.wfile, h2_conn, stream_id=id, headers=[
|
self._send_request(client.wfile, h2_conn, stream_id=stream_id, headers=[
|
||||||
(':authority', "127.0.0.1:{}".format(self.server.server.address.port)),
|
(':authority', "127.0.0.1:{}".format(self.server.server.address.port)),
|
||||||
(':method', 'GET'),
|
(':method', 'GET'),
|
||||||
(':scheme', 'https'),
|
(':scheme', 'https'),
|
||||||
(':path', '/'),
|
(':path', '/'),
|
||||||
('X-Stream-ID', str(id)),
|
('X-Stream-ID', str(stream_id)),
|
||||||
])
|
])
|
||||||
|
|
||||||
ended_streams = 0
|
ended_streams = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user