Mercurial > hg > nginx
comparison src/http/v3/ngx_http_v3_request.c @ 9063:e3760b9b7c8e quic
HTTP/3: fixed $connection_time.
Previously, start_time wasn't set for a new stream.
The fix is to derive it from the parent connection.
Also it's used to simplify tracking keepalive_time.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 10 Jan 2023 17:59:16 +0400 |
parents | b87a0dbc1150 |
children | eaa8dc3788e1 |
comparison
equal
deleted
inserted
replaced
9062:987bee4363d1 | 9063:e3760b9b7c8e |
---|---|
163 static void | 163 static void |
164 ngx_http_v3_init_request_stream(ngx_connection_t *c) | 164 ngx_http_v3_init_request_stream(ngx_connection_t *c) |
165 { | 165 { |
166 uint64_t n; | 166 uint64_t n; |
167 ngx_event_t *rev; | 167 ngx_event_t *rev; |
168 ngx_connection_t *pc; | |
169 ngx_pool_cleanup_t *cln; | 168 ngx_pool_cleanup_t *cln; |
170 ngx_http_connection_t *hc; | 169 ngx_http_connection_t *hc; |
171 ngx_http_v3_session_t *h3c; | 170 ngx_http_v3_session_t *h3c; |
172 ngx_http_core_loc_conf_t *clcf; | 171 ngx_http_core_loc_conf_t *clcf; |
173 ngx_http_core_srv_conf_t *cscf; | 172 ngx_http_core_srv_conf_t *cscf; |
197 c->close = 1; | 196 c->close = 1; |
198 ngx_http_close_connection(c); | 197 ngx_http_close_connection(c); |
199 return; | 198 return; |
200 } | 199 } |
201 | 200 |
202 pc = c->quic->parent; | |
203 | |
204 h3c->next_request_id = c->quic->id + 0x04; | 201 h3c->next_request_id = c->quic->id + 0x04; |
205 | 202 |
206 if (n + 1 == clcf->keepalive_requests | 203 if (n + 1 == clcf->keepalive_requests |
207 || ngx_current_msec - pc->start_time > clcf->keepalive_time) | 204 || ngx_current_msec - c->start_time > clcf->keepalive_time) |
208 { | 205 { |
209 h3c->goaway = 1; | 206 h3c->goaway = 1; |
210 | 207 |
211 #if (NGX_HTTP_V3_HQ) | 208 #if (NGX_HTTP_V3_HQ) |
212 if (!h3c->hq) | 209 if (!h3c->hq) |