Latest update - 9196

This commit is contained in:
2023-12-13 18:22:34 +09:00
parent b4745d7a71
commit 360bc708c7
4 changed files with 26 additions and 8 deletions
+1 -8
View File
@@ -260,14 +260,7 @@ ngx_quic_new_connection(ngx_connection_t *c, ngx_quic_conf_t *conf,
ngx_queue_init(&qc->free_frames); ngx_queue_init(&qc->free_frames);
qc->avg_rtt = NGX_QUIC_INITIAL_RTT; ngx_quic_init_rtt(qc);
qc->rttvar = NGX_QUIC_INITIAL_RTT / 2;
qc->min_rtt = NGX_TIMER_INFINITE;
qc->first_rtt = NGX_TIMER_INFINITE;
/*
* qc->latest_rtt = 0
*/
qc->pto.log = c->log; qc->pto.log = c->log;
qc->pto.data = c; qc->pto.data = c;
+8
View File
@@ -325,6 +325,10 @@ ngx_quic_congestion_ack(ngx_connection_t *c, ngx_quic_frame_t *f)
qc = ngx_quic_get_connection(c); qc = ngx_quic_get_connection(c);
cg = &qc->congestion; cg = &qc->congestion;
if (f->pnum < qc->rst_pnum) {
return;
}
blocked = (cg->in_flight >= cg->window) ? 1 : 0; blocked = (cg->in_flight >= cg->window) ? 1 : 0;
cg->in_flight -= f->plen; 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); qc = ngx_quic_get_connection(c);
cg = &qc->congestion; cg = &qc->congestion;
if (f->pnum < qc->rst_pnum) {
return;
}
blocked = (cg->in_flight >= cg->window) ? 1 : 0; blocked = (cg->in_flight >= cg->window) ? 1 : 0;
cg->in_flight -= f->plen; cg->in_flight -= f->plen;
@@ -65,6 +65,13 @@ typedef struct ngx_quic_keys_s ngx_quic_keys_t;
#define ngx_quic_get_socket(c) ((ngx_quic_socket_t *)((c)->udp)) #define ngx_quic_get_socket(c) ((ngx_quic_socket_t *)((c)->udp))
#define ngx_quic_init_rtt(qc) \
(qc)->avg_rtt = NGX_QUIC_INITIAL_RTT; \
(qc)->rttvar = NGX_QUIC_INITIAL_RTT / 2; \
(qc)->min_rtt = NGX_TIMER_INFINITE; \
(qc)->first_rtt = NGX_TIMER_INFINITE; \
(qc)->latest_rtt = 0;
typedef enum { typedef enum {
NGX_QUIC_PATH_IDLE = 0, NGX_QUIC_PATH_IDLE = 0,
@@ -259,6 +266,8 @@ struct ngx_quic_connection_s {
ngx_quic_streams_t streams; ngx_quic_streams_t streams;
ngx_quic_congestion_t congestion; ngx_quic_congestion_t congestion;
uint64_t rst_pnum; /* first on validated path */
off_t received; off_t received;
ngx_uint_t error; ngx_uint_t error;
@@ -110,6 +110,7 @@ ngx_quic_handle_path_response_frame(ngx_connection_t *c,
ngx_uint_t rst; ngx_uint_t rst;
ngx_queue_t *q; ngx_queue_t *q;
ngx_quic_path_t *path, *prev; ngx_quic_path_t *path, *prev;
ngx_quic_send_ctx_t *ctx;
ngx_quic_connection_t *qc; ngx_quic_connection_t *qc;
qc = ngx_quic_get_connection(c); qc = ngx_quic_get_connection(c);
@@ -174,6 +175,11 @@ valid:
} }
if (rst) { 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)); ngx_memzero(&qc->congestion, sizeof(ngx_quic_congestion_t));
qc->congestion.window = ngx_min(10 * qc->tp.max_udp_payload_size, qc->congestion.window = ngx_min(10 * qc->tp.max_udp_payload_size,
@@ -181,6 +187,8 @@ valid:
14720)); 14720));
qc->congestion.ssthresh = (size_t) -1; qc->congestion.ssthresh = (size_t) -1;
qc->congestion.recovery_start = ngx_current_msec; qc->congestion.recovery_start = ngx_current_msec;
ngx_quic_init_rtt(qc);
} }
path->validated = 1; path->validated = 1;