aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/event/quic/ngx_event_quic_ack.c8
-rw-r--r--src/event/quic/ngx_event_quic_connection.h2
-rw-r--r--src/event/quic/ngx_event_quic_migration.c6
3 files changed, 16 insertions, 0 deletions
diff --git a/src/event/quic/ngx_event_quic_ack.c b/src/event/quic/ngx_event_quic_ack.c
index deeaae1e3..c7ffd44dd 100644
--- a/src/event/quic/ngx_event_quic_ack.c
+++ b/src/event/quic/ngx_event_quic_ack.c
@@ -325,6 +325,10 @@ ngx_quic_congestion_ack(ngx_connection_t *c, ngx_quic_frame_t *f)
qc = ngx_quic_get_connection(c);
cg = &qc->congestion;
+ if (f->pnum < qc->rst_pnum) {
+ return;
+ }
+
blocked = (cg->in_flight >= cg->window) ? 1 : 0;
cg->in_flight -= f->plen;
@@ -667,6 +671,10 @@ ngx_quic_congestion_lost(ngx_connection_t *c, ngx_quic_frame_t *f)
qc = ngx_quic_get_connection(c);
cg = &qc->congestion;
+ if (f->pnum < qc->rst_pnum) {
+ return;
+ }
+
blocked = (cg->in_flight >= cg->window) ? 1 : 0;
cg->in_flight -= f->plen;
diff --git a/src/event/quic/ngx_event_quic_connection.h b/src/event/quic/ngx_event_quic_connection.h
index ae771bcc5..824c92b57 100644
--- a/src/event/quic/ngx_event_quic_connection.h
+++ b/src/event/quic/ngx_event_quic_connection.h
@@ -266,6 +266,8 @@ struct ngx_quic_connection_s {
ngx_quic_streams_t streams;
ngx_quic_congestion_t congestion;
+ uint64_t rst_pnum; /* first on validated path */
+
off_t received;
ngx_uint_t error;
diff --git a/src/event/quic/ngx_event_quic_migration.c b/src/event/quic/ngx_event_quic_migration.c
index 58f3fc545..3c1bbaf43 100644
--- a/src/event/quic/ngx_event_quic_migration.c
+++ b/src/event/quic/ngx_event_quic_migration.c
@@ -110,6 +110,7 @@ ngx_quic_handle_path_response_frame(ngx_connection_t *c,
ngx_uint_t rst;
ngx_queue_t *q;
ngx_quic_path_t *path, *prev;
+ ngx_quic_send_ctx_t *ctx;
ngx_quic_connection_t *qc;
qc = ngx_quic_get_connection(c);
@@ -174,6 +175,11 @@ valid:
}
if (rst) {
+ /* prevent old path packets contribution to congestion control */
+
+ ctx = ngx_quic_get_send_ctx(qc, ssl_encryption_application);
+ qc->rst_pnum = ctx->pnum;
+
ngx_memzero(&qc->congestion, sizeof(ngx_quic_congestion_t));
qc->congestion.window = ngx_min(10 * qc->tp.max_udp_payload_size,