comparison src/http/v3/ngx_http_v3_request.c @ 9158:ad3d34ddfdcc

QUIC: "handshake_timeout" configuration parameter. Previously QUIC did not have such parameter and handshake duration was controlled by HTTP/3. However that required creating and storing HTTP/3 session on first client datagram. Apparently there's no convenient way to store the session object until QUIC handshake is complete. In the followup patches session creation will be postponed to init() callback.
author Roman Arutyunyan <arut@nginx.com>
date Wed, 13 Sep 2023 17:59:37 +0400
parents 69bae2437d74
children 6d3ca6f8db35
comparison
equal deleted inserted replaced
9157:daf8f5ba23d8 9158:ad3d34ddfdcc
56 56
57 57
58 void 58 void
59 ngx_http_v3_init_stream(ngx_connection_t *c) 59 ngx_http_v3_init_stream(ngx_connection_t *c)
60 { 60 {
61 ngx_http_v3_session_t *h3c;
62 ngx_http_connection_t *hc, *phc; 61 ngx_http_connection_t *hc, *phc;
63 ngx_http_v3_srv_conf_t *h3scf; 62 ngx_http_v3_srv_conf_t *h3scf;
64 ngx_http_core_loc_conf_t *clcf; 63 ngx_http_core_loc_conf_t *clcf;
65 ngx_http_core_srv_conf_t *cscf;
66 64
67 hc = c->data; 65 hc = c->data;
68 66
69 hc->ssl = 1; 67 hc->ssl = 1;
70 68
71 clcf = ngx_http_get_module_loc_conf(hc->conf_ctx, ngx_http_core_module); 69 clcf = ngx_http_get_module_loc_conf(hc->conf_ctx, ngx_http_core_module);
72 cscf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_core_module);
73 h3scf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_v3_module); 70 h3scf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_v3_module);
74 71
75 if (c->quic == NULL) { 72 if (c->quic == NULL) {
76 if (ngx_http_v3_init_session(c) != NGX_OK) { 73 if (ngx_http_v3_init_session(c) != NGX_OK) {
77 ngx_http_close_connection(c); 74 ngx_http_close_connection(c);
78 return; 75 return;
79 } 76 }
80 77
81 h3c = hc->v3_session; 78 h3scf->quic.idle_timeout = clcf->keepalive_timeout;
82 ngx_add_timer(&h3c->keepalive, cscf->client_header_timeout);
83
84 h3scf->quic.timeout = clcf->keepalive_timeout;
85 ngx_quic_run(c, &h3scf->quic); 79 ngx_quic_run(c, &h3scf->quic);
86 return; 80 return;
87 } 81 }
88 82
89 phc = ngx_http_quic_get_connection(c); 83 phc = ngx_http_quic_get_connection(c);