Skip to content

Commit 7bdaebf

Browse files
G1gg1L3spgjones
authored andcommitted
h3: Remove streams on StreamClosed
1 parent cd992f8 commit 7bdaebf

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • src/hypercorn/protocol

src/hypercorn/protocol/h3.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ async def stream_send(self, event: StreamEvent) -> None:
8686
self.connection.send_headers(event.stream_id, event.headers)
8787
await self.send()
8888
elif isinstance(event, StreamClosed):
89-
pass # ??
89+
# Remove a stream when it's closed to avoid memory leaks
90+
self.streams.pop(event.stream_id, None)
9091
elif isinstance(event, Request):
9192
await self._create_server_push(event.stream_id, event.raw_path, event.headers)
9293

0 commit comments

Comments
 (0)