comparison src/event/quic/ngx_event_quic_migration.c @ 8756:118a34e32121 quic

QUIC: added missing check for backup path existence.
author Vladimir Homutov <vl@nginx.com>
date Thu, 16 Dec 2021 11:42:28 +0300
parents fb41e37ddeb0
children b7284807b4fa
comparison
equal deleted inserted replaced
8755:5c86189a1c1b 8756:118a34e32121
79 79
80 ngx_int_t 80 ngx_int_t
81 ngx_quic_handle_path_response_frame(ngx_connection_t *c, 81 ngx_quic_handle_path_response_frame(ngx_connection_t *c,
82 ngx_quic_path_challenge_frame_t *f) 82 ngx_quic_path_challenge_frame_t *f)
83 { 83 {
84 ngx_uint_t rst;
84 ngx_queue_t *q; 85 ngx_queue_t *q;
85 ngx_quic_path_t *path, *prev; 86 ngx_quic_path_t *path, *prev;
86 ngx_quic_connection_t *qc; 87 ngx_quic_connection_t *qc;
87 88
88 qc = ngx_quic_get_connection(c); 89 qc = ngx_quic_get_connection(c);
125 * an endpoint MUST immediately reset the congestion controller 126 * an endpoint MUST immediately reset the congestion controller
126 * and round-trip time estimator for the new path to initial values 127 * and round-trip time estimator for the new path to initial values
127 * unless the only change in the peer's address is its port number. 128 * unless the only change in the peer's address is its port number.
128 */ 129 */
129 130
130 prev = qc->backup->path; 131 rst = 1;
131 132
132 if (ngx_cmp_sockaddr(prev->sockaddr, prev->socklen, 133 if (qc->backup) {
133 path->sockaddr, path->socklen, 0) 134 prev = qc->backup->path;
134 != NGX_OK) 135
135 { 136 if (ngx_cmp_sockaddr(prev->sockaddr, prev->socklen,
136 /* address has changed */ 137 path->sockaddr, path->socklen, 0)
138 == NGX_OK)
139 {
140 /* address did not change */
141 rst = 0;
142 }
143 }
144
145 if (rst) {
137 ngx_memzero(&qc->congestion, sizeof(ngx_quic_congestion_t)); 146 ngx_memzero(&qc->congestion, sizeof(ngx_quic_congestion_t));
138 147
139 qc->congestion.window = ngx_min(10 * qc->tp.max_udp_payload_size, 148 qc->congestion.window = ngx_min(10 * qc->tp.max_udp_payload_size,
140 ngx_max(2 * qc->tp.max_udp_payload_size, 149 ngx_max(2 * qc->tp.max_udp_payload_size,
141 14720)); 150 14720));