]> git.kaiwu.me - nginx.git/commitdiff
QUIC: fixed congesion control in GSO mode.
authorRoman Arutyunyan <arut@nginx.com>
Thu, 27 Jul 2023 09:35:42 +0000 (13:35 +0400)
committerRoman Arutyunyan <arut@nginx.com>
Thu, 27 Jul 2023 09:35:42 +0000 (13:35 +0400)
In non-GSO mode, a datagram is sent if congestion window is not exceeded by the
time of send.  The window could be exceeded by a small amount after the send.
In GSO mode, congestion window was checked in a similar way, but for all
concatenated datagrams as a whole.  This could result in exceeding congestion
window by a lot.  Now congestion window is checked for every datagram in GSO
mode as well.

src/event/quic/ngx_event_quic_output.c

index 88b7df6ab1056014a167f3643343a5bd43eb0a43..37de44c749e2ce49d3548838eef16607c85b46d8 100644 (file)
@@ -358,7 +358,7 @@ ngx_quic_create_segments(ngx_connection_t *c)
 
         len = ngx_min(segsize, (size_t) (end - p));
 
-        if (len && cg->in_flight < cg->window) {
+        if (len && cg->in_flight + (p - dst) < cg->window) {
 
             n = ngx_quic_output_packet(c, ctx, p, len, len);
             if (n == NGX_ERROR) {