From 83a443948508008c0bf2e03a28637312b1911b6a Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Tue, 19 Jan 2016 22:22:36 +0100 Subject: [PATCH] fix flow control on closed streams --- libmproxy/protocol/http.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py index 276af1322..3049e34c3 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()