q = ngx_queue_last(&ctx->sent);
f = ngx_queue_data(q, ngx_quic_frame_t, queue);
- w = (ngx_msec_int_t) (f->last + ngx_quic_pto(c, ctx) - now);
+ w = (ngx_msec_int_t) (f->last + (ngx_quic_pto(c, ctx) << qc->pto_count)
+ - now);
if (w < 0) {
w = 0;
duration = qc->avg_rtt;
duration += ngx_max(4 * qc->rttvar, NGX_QUIC_TIME_GRANULARITY);
- duration <<= qc->pto_count;
if (ctx->level == ssl_encryption_application && c->ssl->handshaked) {
- duration += qc->ctp.max_ack_delay << qc->pto_count;
+ duration += qc->ctp.max_ack_delay;
}
return duration;
continue;
}
- if ((ngx_msec_int_t) (f->last + ngx_quic_pto(c, ctx) - now) > 0) {
+ if ((ngx_msec_int_t) (f->last + (ngx_quic_pto(c, ctx) << qc->pto_count)
+ - now) > 0)
+ {
continue;
}
"quic initiated validation of path seq:%uL", path->seqnum);
path->validating = 1;
+ path->tries = 0;
if (RAND_bytes(path->challenge1, 8) != 1) {
return NGX_ERROR;
pto = ngx_quic_pto(c, ctx);
path->expires = ngx_current_msec + pto;
- path->tries = NGX_QUIC_PATH_RETRIES;
if (!qc->path_validation.timer_set) {
ngx_add_timer(&qc->path_validation, pto);
qc = ngx_quic_get_connection(c);
ctx = ngx_quic_get_send_ctx(qc, ssl_encryption_application);
- pto = ngx_quic_pto(c, ctx);
next = -1;
now = ngx_current_msec;
continue;
}
- if (--path->tries) {
+ if (++path->tries < NGX_QUIC_PATH_RETRIES) {
+ pto = ngx_quic_pto(c, ctx) << path->tries;
+
path->expires = ngx_current_msec + pto;
if (next == -1 || pto < next) {