aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2016-01-19 22:22:36 +0100
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2016-02-04 09:52:02 +0100
commit83a443948508008c0bf2e03a28637312b1911b6a (patch)
tree6034618271eab312f3656c255e065ec8e75e31e9
parent3f5e7987430f94d885e61b0d7c035f4318374990 (diff)
downloadmitmproxy-83a443948508008c0bf2e03a28637312b1911b6a.tar.gz
mitmproxy-83a443948508008c0bf2e03a28637312b1911b6a.tar.bz2
mitmproxy-83a443948508008c0bf2e03a28637312b1911b6a.zip
fix flow control on closed streams
-rw-r--r--libmproxy/protocol/http.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py
index 276af132..3049e34c 100644
--- a/libmproxy/protocol/http.py
+++ b/libmproxy/protocol/http.py
@@ -185,14 +185,14 @@ class SafeH2Connection(H2Connection):
position = 0
while position < len(chunk):
self.lock.acquire()
+ if is_zombie(self, stream_id):
+ return
max_outbound_frame_size = self.max_outbound_frame_size
frame_chunk = chunk[position:position+max_outbound_frame_size]
if self.local_flow_control_window(stream_id) < len(frame_chunk):
self.lock.release()
time.sleep(0)
continue
- if is_zombie(self, stream_id):
- return
self.send_data(stream_id, frame_chunk)
self.conn.send(self.data_to_send())
self.lock.release()