]> git.kaiwu.me - nginx.git/commitdiff
QUIC: fixed processing of minimum packet size.
authorVladimir Homutov <vl@nginx.com>
Fri, 22 Oct 2021 09:59:44 +0000 (12:59 +0300)
committerVladimir Homutov <vl@nginx.com>
Fri, 22 Oct 2021 09:59:44 +0000 (12:59 +0300)
If packet needs to be expanded (for example Initial to 1200 bytes),
but path limit is less, such packet should not be created/sent.

src/event/quic/ngx_event_quic_output.c

index dbcdb70d5cadd06d1ed3faf3ad35ad5cda3a459e..d7e74a63a9966728dfbb5cf351c75b624938ecca 100644 (file)
@@ -184,6 +184,10 @@ ngx_quic_create_datagrams(ngx_connection_t *c, ngx_quic_socket_t *qsock)
             min = (i == pad && p - dst < NGX_QUIC_MIN_INITIAL_SIZE)
                   ? NGX_QUIC_MIN_INITIAL_SIZE - (p - dst) : 0;
 
+            if (min > len) {
+                continue;
+            }
+
             n = ngx_quic_output_packet(c, ctx, p, len, min, qsock);
             if (n == NGX_ERROR) {
                 return NGX_ERROR;