Skip to content

Commit 0eeb531

Browse files
committed
🐛 only try to close stream (asyncio Protocol)
1 parent 3bd4fc8 commit 0eeb531

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
**Misc**
99
- Support for PyPy 3.11
1010

11+
**Fixed**
12+
- Asyncio Protocol may raise AssertionError upon closing if the FIN bit was already sent in a given stream.s
13+
1114
1.4.1 (2025-02-05)
1215
====================
1316

qh3/asyncio/protocol.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,4 +254,7 @@ def close(self):
254254
return # Defensive:
255255
if self.stream_id in self.protocol._quic._streams_finished:
256256
return # Defensive:
257-
self.protocol._quic.send_stream_data(self.stream_id, b"", True)
257+
try:
258+
self.protocol._quic.send_stream_data(self.stream_id, b"", True)
259+
except AssertionError:
260+
pass # Defensive: avoid duplicate call (FIN bit may already be set!)

0 commit comments

Comments
 (0)