aboutsummaryrefslogtreecommitdiff
path: root/src/http/v3/ngx_http_v3_request.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/v3/ngx_http_v3_request.c')
-rw-r--r--src/http/v3/ngx_http_v3_request.c38
1 files changed, 33 insertions, 5 deletions
diff --git a/src/http/v3/ngx_http_v3_request.c b/src/http/v3/ngx_http_v3_request.c
index cbfede836..2e7dd811d 100644
--- a/src/http/v3/ngx_http_v3_request.c
+++ b/src/http/v3/ngx_http_v3_request.c
@@ -57,18 +57,29 @@ static const struct {
void
ngx_http_v3_init_stream(ngx_connection_t *c)
{
+ ngx_http_v3_session_t *h3c;
ngx_http_connection_t *hc, *phc;
ngx_http_v3_srv_conf_t *h3scf;
ngx_http_core_loc_conf_t *clcf;
+ ngx_http_core_srv_conf_t *cscf;
hc = c->data;
hc->ssl = 1;
clcf = ngx_http_get_module_loc_conf(hc->conf_ctx, ngx_http_core_module);
+ cscf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_core_module);
h3scf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_v3_module);
if (c->quic == NULL) {
+ if (ngx_http_v3_init_session(c) != NGX_OK) {
+ ngx_http_close_connection(c);
+ return;
+ }
+
+ h3c = hc->v3_session;
+ ngx_add_timer(&h3c->keepalive, cscf->client_header_timeout);
+
h3scf->quic.timeout = clcf->keepalive_timeout;
ngx_quic_run(c, &h3scf->quic);
return;
@@ -86,11 +97,6 @@ ngx_http_v3_init_stream(ngx_connection_t *c)
ngx_set_connection_log(c, clcf->error_log);
}
- if (ngx_http_v3_init_session(c) != NGX_OK) {
- ngx_http_close_connection(c);
- return;
- }
-
if (c->quic->id & NGX_QUIC_STREAM_UNIDIRECTIONAL) {
ngx_http_v3_init_uni_stream(c);
@@ -100,6 +106,28 @@ ngx_http_v3_init_stream(ngx_connection_t *c)
}
+ngx_int_t
+ngx_http_v3_init(ngx_connection_t *c)
+{
+ ngx_http_v3_session_t *h3c;
+ ngx_http_core_loc_conf_t *clcf;
+
+ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http3 init");
+
+ h3c = ngx_http_v3_get_session(c);
+ clcf = ngx_http_v3_get_module_loc_conf(c, ngx_http_core_module);
+ ngx_add_timer(&h3c->keepalive, clcf->keepalive_timeout);
+
+#if (NGX_HTTP_V3_HQ)
+ if (h3c->hq) {
+ return NGX_OK;
+ }
+#endif
+
+ return ngx_http_v3_send_settings(c);
+}
+
+
void
ngx_http_v3_shutdown(ngx_connection_t *c)
{