mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-27 02:24:18 +00:00
Merge pull request #1870 from Kriechi/http2-timeouts
http2: faster timeouts
This commit is contained in:
commit
39a251a988
@ -328,7 +328,7 @@ class Http2Layer(base.Layer):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
while True:
|
while True:
|
||||||
r = tcp.ssl_read_select(conns, 1)
|
r = tcp.ssl_read_select(conns, 0.1)
|
||||||
for conn in r:
|
for conn in r:
|
||||||
source_conn = self.client_conn if conn == self.client_conn.connection else self.server_conn
|
source_conn = self.client_conn if conn == self.client_conn.connection else self.server_conn
|
||||||
other_conn = self.server_conn if conn == self.client_conn.connection else self.client_conn
|
other_conn = self.server_conn if conn == self.client_conn.connection else self.client_conn
|
||||||
@ -580,7 +580,7 @@ class Http2SingleStreamLayer(httpbase._HttpTransmissionLayer, basethread.BaseThr
|
|||||||
def read_response_body(self, request, response):
|
def read_response_body(self, request, response):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
yield self.response_data_queue.get(timeout=1)
|
yield self.response_data_queue.get(timeout=0.1)
|
||||||
except queue.Empty: # pragma: no cover
|
except queue.Empty: # pragma: no cover
|
||||||
pass
|
pass
|
||||||
if self.response_data_finished.is_set():
|
if self.response_data_finished.is_set():
|
||||||
|
Loading…
Reference in New Issue
Block a user