qc->streams.client_max_streams_uni = qc->tp.initial_max_streams_uni;
qc->streams.client_max_streams_bidi = qc->tp.initial_max_streams_bidi;
- qc->congestion.window = ngx_min(10 * qc->tp.max_udp_payload_size,
- ngx_max(2 * qc->tp.max_udp_payload_size,
+ qc->congestion.window = ngx_min(10 * NGX_QUIC_MIN_INITIAL_SIZE,
+ ngx_max(2 * NGX_QUIC_MIN_INITIAL_SIZE,
14720));
qc->congestion.ssthresh = (size_t) -1;
qc->congestion.recovery_start = ngx_current_msec;
now, cg->window, cg->ssthresh, cg->in_flight);
} else {
- cg->window += qc->tp.max_udp_payload_size * f->plen / cg->window;
+ cg->window += (uint64_t) qc->path->mtu * f->plen / cg->window;
ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
"quic congestion ack reno t:%M win:%uz if:%uz",
now = ngx_current_msec;
cg->recovery_start = now;
- cg->window = qc->tp.max_udp_payload_size * 2;
+ cg->window = qc->path->mtu * 2;
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
"quic congestion persistent t:%M win:%uz", now, cg->window);
cg->recovery_start = now;
cg->window /= 2;
- if (cg->window < qc->tp.max_udp_payload_size * 2) {
- cg->window = qc->tp.max_udp_payload_size * 2;
+ if (cg->window < qc->path->mtu * 2) {
+ cg->window = qc->path->mtu * 2;
}
cg->ssthresh = cg->window;
ngx_memzero(&qc->congestion, sizeof(ngx_quic_congestion_t));
- qc->congestion.window = ngx_min(10 * qc->tp.max_udp_payload_size,
- ngx_max(2 * qc->tp.max_udp_payload_size,
+ qc->congestion.window = ngx_min(10 * NGX_QUIC_MIN_INITIAL_SIZE,
+ ngx_max(2 * NGX_QUIC_MIN_INITIAL_SIZE,
14720));
qc->congestion.ssthresh = (size_t) -1;
qc->congestion.recovery_start = ngx_current_msec;