From ef16f3c99310088c9cfb3df60d5266c2b1074720 Mon Sep 17 00:00:00 2001 From: acul71 <34693171+acul71@users.noreply.github.com> Date: Sun, 29 Jun 2025 10:50:17 +0200 Subject: [PATCH] fix: accept new streams for both DATA and WINDOW_UPDATE frames with the SYN flag (#702) * fix: accept new streams for both and frames with the flag * doc: newsfragment --------- Co-authored-by: Manu Sheel Gupta --- libp2p/stream_muxer/yamux/yamux.py | 2 +- newsfragments/701.bugfix.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 newsfragments/701.bugfix.rst diff --git a/libp2p/stream_muxer/yamux/yamux.py b/libp2p/stream_muxer/yamux/yamux.py index 92123465..586bbc2d 100644 --- a/libp2p/stream_muxer/yamux/yamux.py +++ b/libp2p/stream_muxer/yamux/yamux.py @@ -493,7 +493,7 @@ class Yamux(IMuxedConn): f"type={typ}, flags={flags}, stream_id={stream_id}," f"length={length}" ) - if typ == TYPE_DATA and flags & FLAG_SYN: + if (typ == TYPE_DATA or typ == TYPE_WINDOW_UPDATE) and flags & FLAG_SYN: async with self.streams_lock: if stream_id not in self.streams: stream = YamuxStream(stream_id, self, False) diff --git a/newsfragments/701.bugfix.rst b/newsfragments/701.bugfix.rst new file mode 100644 index 00000000..2bb1be5d --- /dev/null +++ b/newsfragments/701.bugfix.rst @@ -0,0 +1 @@ +align stream creation logic with yamux specification