Skip to content

Commit 3eedf1e

Browse files
authored
fix mock server window update on 0 length body (#517)
1 parent ca7e0e2 commit 3eedf1e

File tree

2 files changed

+7
-34
lines changed

2 files changed

+7
-34
lines changed

.travis/travis_build.sh

-30
This file was deleted.

tests/py_localhost/server.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,13 @@ def receive_data(self, data: bytes, stream_id: int, flow_controlled_length: int)
157157
expecting data on, save it off. Otherwise, reset the stream.
158158
"""
159159
try:
160-
self.conn.increment_flow_control_window(
161-
flow_controlled_length)
162-
self.conn.increment_flow_control_window(
163-
flow_controlled_length, stream_id)
160+
if flow_controlled_length > 0:
161+
# We need to update the flow control window for the stream
162+
# and the connection. And the function only accepts value > 0.
163+
self.conn.increment_flow_control_window(
164+
flow_controlled_length)
165+
self.conn.increment_flow_control_window(
166+
flow_controlled_length, stream_id)
164167
stream_data = self.stream_data[stream_id]
165168
except KeyError:
166169
self.conn.reset_stream(

0 commit comments

Comments
 (0)