mirror of
https://github.com/nginx/nginx.git
synced 2026-05-28 04:12:47 -04:00
QUIC: fixed congestion window check in ngx_quic_allow_segmentation().
QUIC segmentation could be skipped when f->len exceeds 3 * mtu and the available congestion window is between 3 * mtu and f->len, because accumulated queued bytes were checked before the batching threshold.
This commit is contained in:
parent
475732a3f9
commit
14f073abf2
1 changed files with 4 additions and 4 deletions
|
|
@ -310,6 +310,10 @@ ngx_quic_allow_segmentation(ngx_connection_t *c)
|
|||
bytes = 0;
|
||||
len = ngx_min(qc->path->mtu, NGX_QUIC_MAX_UDP_SEGMENT_BUF);
|
||||
|
||||
if (qc->congestion.in_flight + len * 3 >= qc->congestion.window) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (q = ngx_queue_head(&ctx->frames);
|
||||
q != ngx_queue_sentinel(&ctx->frames);
|
||||
q = ngx_queue_next(q))
|
||||
|
|
@ -318,10 +322,6 @@ ngx_quic_allow_segmentation(ngx_connection_t *c)
|
|||
|
||||
bytes += f->len;
|
||||
|
||||
if (qc->congestion.in_flight + bytes >= qc->congestion.window) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (bytes > len * 3) {
|
||||
/* require at least ~3 full packets to batch */
|
||||
return 1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue