]> git.kaiwu.me - nginx.git/commitdiff
QUIC: prevent deleted stream frame retransmissions.
authornandsky <lishu.zy@alibaba-inc.com>
Mon, 30 Sep 2024 12:51:17 +0000 (20:51 +0800)
committerRoman Arutyunyan <arutyunyan.roman@gmail.com>
Tue, 8 Oct 2024 15:55:14 +0000 (19:55 +0400)
Since a2a513b93cae, stream frames no longer need to be retransmitted after it
was deleted.  The frames which were retransmitted before, could be stream data
frames sent prior to a RESET_STREAM. Such retransmissions are explicitly
prohibited by RFC 9000, Section 19.4.

src/event/quic/ngx_event_quic_ack.c

index c7ffd44dd77e9c9ce8243c394296911deceafd05..c953b8042ec621d0bfb1f5f15d1db5068b081d18 100644 (file)
@@ -631,13 +631,12 @@ ngx_quic_resend_frames(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx)
         case NGX_QUIC_FT_STREAM:
             qs = ngx_quic_find_stream(&qc->streams.tree, f->u.stream.stream_id);
 
-            if (qs) {
-                if (qs->send_state == NGX_QUIC_STREAM_SEND_RESET_SENT
-                    || qs->send_state == NGX_QUIC_STREAM_SEND_RESET_RECVD)
-                {
-                    ngx_quic_free_frame(c, f);
-                    break;
-                }
+            if (qs == NULL
+                || qs->send_state == NGX_QUIC_STREAM_SEND_RESET_SENT
+                || qs->send_state == NGX_QUIC_STREAM_SEND_RESET_RECVD)
+            {
+                ngx_quic_free_frame(c, f);
+                break;
             }
 
             /* fall through */