Mercurial > hg > nginx-quic
comparison src/event/quic/ngx_event_quic_migration.c @ 9083:a9fef6ca45a8 quic
QUIC: lower bound path validation PTO.
According to RFC 9000, 8.2.4. Failed Path Validation,
the following value is recommended as a validation timeout:
A value of three times the larger of the current PTO
or the PTO for the new path (using kInitialRtt, as
defined in [QUIC-RECOVERY]) is RECOMMENDED.
The change adds PTO of the new path to the equation as the lower bound.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 09 May 2023 19:42:40 +0400 |
parents | c6db94ec3841 |
children | d565cf69ff5d |
comparison
equal
deleted
inserted
replaced
9082:c6db94ec3841 | 9083:a9fef6ca45a8 |
---|---|
509 if (ngx_quic_send_path_challenge(c, path) != NGX_OK) { | 509 if (ngx_quic_send_path_challenge(c, path) != NGX_OK) { |
510 return NGX_ERROR; | 510 return NGX_ERROR; |
511 } | 511 } |
512 | 512 |
513 ctx = ngx_quic_get_send_ctx(qc, ssl_encryption_application); | 513 ctx = ngx_quic_get_send_ctx(qc, ssl_encryption_application); |
514 pto = ngx_quic_pto(c, ctx); | 514 pto = ngx_max(ngx_quic_pto(c, ctx), 1000); |
515 | 515 |
516 path->expires = ngx_current_msec + pto; | 516 path->expires = ngx_current_msec + pto; |
517 | 517 |
518 if (!qc->path_validation.timer_set) { | 518 if (!qc->path_validation.timer_set) { |
519 ngx_add_timer(&qc->path_validation, pto); | 519 ngx_add_timer(&qc->path_validation, pto); |
603 | 603 |
604 continue; | 604 continue; |
605 } | 605 } |
606 | 606 |
607 if (++path->tries < NGX_QUIC_PATH_RETRIES) { | 607 if (++path->tries < NGX_QUIC_PATH_RETRIES) { |
608 pto = ngx_quic_pto(c, ctx) << path->tries; | 608 pto = ngx_max(ngx_quic_pto(c, ctx), 1000) << path->tries; |
609 | 609 |
610 path->expires = ngx_current_msec + pto; | 610 path->expires = ngx_current_msec + pto; |
611 | 611 |
612 if (next == -1 || pto < next) { | 612 if (next == -1 || pto < next) { |
613 next = pto; | 613 next = pto; |