From 6f8460a8212e2d8896c3317d38eb36474a63d91c Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Sat, 10 May 2025 20:41:47 +0800 Subject: [PATCH] http3: keep datagram receive loop running on datagram for unknown stream (#5136) --- http3/conn.go | 7 +++---- http3/conn_test.go | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/http3/conn.go b/http3/conn.go index 1a9a410e7..cbbe4445d 100644 --- a/http3/conn.go +++ b/http3/conn.go @@ -308,11 +308,10 @@ func (c *connection) receiveDatagrams() error { streamID := protocol.StreamID(4 * quarterStreamID) c.streamMx.Lock() dg, ok := c.streams[streamID] - if !ok { - c.streamMx.Unlock() - return nil - } c.streamMx.Unlock() + if !ok { + continue + } dg.enqueue(b[n:]) } } diff --git a/http3/conn_test.go b/http3/conn_test.go index 7eb338404..d97508de2 100644 --- a/http3/conn_test.go +++ b/http3/conn_test.go @@ -392,6 +392,7 @@ var _ = Describe("Connection", func() { close(delivered) return b, nil }) + qconn.EXPECT().ReceiveDatagram(gomock.Any()).Return(nil, errors.New("test done")) go func() { defer GinkgoRecover() conn.handleUnidirectionalStreams(nil)