Mercurial > hg > nginx
comparison src/http/v3/ngx_http_v3_request.c @ 8768:40d710a66aef quic
HTTP/3: ngx_http_v3_get_session() macro.
It's used instead of accessing c->quic->parent->data directly. Apart from being
simpler, it allows to change the way session is stored in the future by changing
the macro.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Fri, 30 Apr 2021 19:10:11 +0300 |
parents | 47a43b011dec |
children | 67f0eb150047 |
comparison
equal
deleted
inserted
replaced
8767:33ec97749b5f | 8768:40d710a66aef |
---|---|
79 | 79 |
80 hc = c->data; | 80 hc = c->data; |
81 | 81 |
82 clcf = ngx_http_get_module_loc_conf(hc->conf_ctx, ngx_http_core_module); | 82 clcf = ngx_http_get_module_loc_conf(hc->conf_ctx, ngx_http_core_module); |
83 | 83 |
84 h3c = c->quic->parent->data; | 84 h3c = ngx_http_v3_get_session(c); |
85 | 85 |
86 if (h3c->goaway) { | 86 if (h3c->goaway) { |
87 ngx_quic_reset_stream(c, NGX_HTTP_V3_ERR_REQUEST_REJECTED); | 87 ngx_quic_reset_stream(c, NGX_HTTP_V3_ERR_REQUEST_REJECTED); |
88 ngx_http_close_connection(c); | 88 ngx_http_close_connection(c); |
89 return; | 89 return; |
186 ngx_connection_t *c = data; | 186 ngx_connection_t *c = data; |
187 | 187 |
188 ngx_http_core_loc_conf_t *clcf; | 188 ngx_http_core_loc_conf_t *clcf; |
189 ngx_http_v3_connection_t *h3c; | 189 ngx_http_v3_connection_t *h3c; |
190 | 190 |
191 h3c = c->quic->parent->data; | 191 h3c = ngx_http_v3_get_session(c); |
192 | 192 |
193 if (--h3c->nrequests == 0) { | 193 if (--h3c->nrequests == 0) { |
194 clcf = ngx_http_v3_get_module_loc_conf(c, ngx_http_core_module); | 194 clcf = ngx_http_v3_get_module_loc_conf(c, ngx_http_core_module); |
195 ngx_add_timer(&h3c->keepalive, clcf->keepalive_timeout); | 195 ngx_add_timer(&h3c->keepalive, clcf->keepalive_timeout); |
196 } | 196 } |