Mercurial > hg > nginx
comparison src/event/quic/ngx_event_quic_output.c @ 9140:e9a003d40485
QUIC: fixed congesion control in GSO mode.
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.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Thu, 27 Jul 2023 13:35:42 +0400 |
parents | d7dec2970161 |
children | 48691bab4474 |
comparison
equal
deleted
inserted
replaced
9139:d7dec2970161 | 9140:e9a003d40485 |
---|---|
356 | 356 |
357 for ( ;; ) { | 357 for ( ;; ) { |
358 | 358 |
359 len = ngx_min(segsize, (size_t) (end - p)); | 359 len = ngx_min(segsize, (size_t) (end - p)); |
360 | 360 |
361 if (len && cg->in_flight < cg->window) { | 361 if (len && cg->in_flight + (p - dst) < cg->window) { |
362 | 362 |
363 n = ngx_quic_output_packet(c, ctx, p, len, len); | 363 n = ngx_quic_output_packet(c, ctx, p, len, len); |
364 if (n == NGX_ERROR) { | 364 if (n == NGX_ERROR) { |
365 return NGX_ERROR; | 365 return NGX_ERROR; |
366 } | 366 } |