Skip to content
Myr

Handle StreamReset, and acknowledge received data (#81)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tom Christie · committed by GitHub · parent d8950ef · Browse files · 1 file+3 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−1 removed

  • other:+3 added−1 removed

1 file+3 added−1 removed

modified:httpcore/dispatch/http2.py+3 added-1 removed
29 unmodified lines
3031 #  Start sending the request.32 if not self.initialized:33 self.initiate_connection()3435 stream_id = await self.send_headers(request, timeout)36 self.events[stream_id] = []3738 # Send the request body.
78 unmodified lines
117 ) -> typing.AsyncIterator[bytes]:118 while True:119 event = await self.receive_event(stream_id, timeout)120 if isinstance(event, h2.events.DataReceived):121 self.h2_state.acknowledge_received_data(len(event.data), stream_id)122 yield event.data121 elif isinstance(event, h2.events.StreamEnded):123 elif isinstance(event, (h2.events.StreamEnded, h2.events.StreamReset)):124 break125126 async def receive_event(127 self, stream_id: int, timeout: TimeoutConfig = None
22 unmodified lines