Skip to content

Commit 8f38a23

Browse files
committed
Correct flow control example
The flow control window can be negative which evaluates to truthy, when sending should still be blocked.
1 parent 96aaef1 commit 8f38a23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/curio/curio-server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ async def _send_file_data(self, fileobj, stream_id):
150150
Send the data portion of a file. Handles flow control rules.
151151
"""
152152
while True:
153-
while not self.conn.local_flow_control_window(stream_id):
153+
while self.conn.local_flow_control_window(stream_id) < 1:
154154
await self.wait_for_flow_control(stream_id)
155155

156156
chunk_size = min(

0 commit comments

Comments
 (0)