"quic path #%uL successfully validated", path->seqnum);
path->state = NGX_QUIC_PATH_VALIDATED;
+ path->limited = 0;
return NGX_OK;
}
return NULL;
}
+ path->state = NGX_QUIC_PATH_NEW;
+ path->limited = 1;
+
path->seqnum = qc->path_seqnum++;
path->last_seen = ngx_current_msec;
/* force limits/revalidation for paths that were not seen recently */
if (ngx_current_msec - path->last_seen > qc->tp.max_idle_timeout) {
path->state = NGX_QUIC_PATH_NEW;
+ path->limited = 1;
path->sent = 0;
path->received = 0;
}
*/
path->received += len;
- ngx_log_debug6(NGX_LOG_DEBUG_EVENT, c->log, 0,
+ ngx_log_debug7(NGX_LOG_DEBUG_EVENT, c->log, 0,
"quic packet via #%uL:%uL:%uL"
- " size:%O path recvd:%O sent:%O",
+ " size:%O path recvd:%O sent:%O limited:%ui",
qsock->sid.seqnum, qsock->cid->seqnum, path->seqnum,
- len, path->received, path->sent);
+ len, path->received, path->sent, path->limited);
return NGX_OK;
}
/* found expired path */
path->state = NGX_QUIC_PATH_NEW;
+ path->limited = 1;
/*
* RFC 9000, 9.4. Loss Detection and Congestion Control
len = ngx_min(qc->ctp.max_udp_payload_size,
NGX_QUIC_MAX_UDP_PAYLOAD_SIZE);
- if (path->state != NGX_QUIC_PATH_VALIDATED) {
+ if (path->limited) {
max = path->received * 3;
max = (path->sent >= max) ? 0 : max - path->sent;
return 0;
}
- if (qsock->path->state != NGX_QUIC_PATH_VALIDATED) {
+ if (qsock->path->limited) {
/* don't even try to be faster on non-validated paths */
return 0;
}
ngx_quic_init_packet(c, ctx, qc->socket, &pkt);
/* account for anti-amplification limit: expand to allowed size */
- if (path->state != NGX_QUIC_PATH_VALIDATED) {
+ if (path->limited) {
max = path->received * 3;
max = (path->sent >= max) ? 0 : max - path->sent;
if ((off_t) min > max) {