comparison src/http/v3/ngx_http_v3.c @ 8986:6546c2ae1c7b quic

HTTP/3: unified hq code with regular HTTP/3 code. The change removes hq-specific request handler. Now hq requests are handled by the HTTP/3 request handler.
author Roman Arutyunyan <arut@nginx.com>
date Wed, 19 Oct 2022 17:45:30 +0400
parents 81a3429db8b0
children be39ffdf9208
comparison
equal deleted inserted replaced
8985:740d7d6e8ff0 8986:6546c2ae1c7b
15 15
16 16
17 ngx_int_t 17 ngx_int_t
18 ngx_http_v3_init_session(ngx_connection_t *c) 18 ngx_http_v3_init_session(ngx_connection_t *c)
19 { 19 {
20 ngx_connection_t *pc; 20 ngx_connection_t *pc;
21 ngx_pool_cleanup_t *cln; 21 ngx_pool_cleanup_t *cln;
22 ngx_http_connection_t *hc; 22 ngx_http_connection_t *hc;
23 ngx_http_v3_session_t *h3c; 23 ngx_http_v3_session_t *h3c;
24 #if (NGX_HTTP_V3_HQ)
25 ngx_http_v3_srv_conf_t *h3scf;
26 #endif
24 27
25 pc = c->quic->parent; 28 pc = c->quic->parent;
26 hc = pc->data; 29 hc = pc->data;
27 30
28 if (hc->v3_session) { 31 if (hc->v3_session) {
36 goto failed; 39 goto failed;
37 } 40 }
38 41
39 h3c->max_push_id = (uint64_t) -1; 42 h3c->max_push_id = (uint64_t) -1;
40 h3c->goaway_push_id = (uint64_t) -1; 43 h3c->goaway_push_id = (uint64_t) -1;
44
45 #if (NGX_HTTP_V3_HQ)
46 h3scf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_v3_module);
47 if (h3scf->hq) {
48 h3c->hq = 1;
49 }
50 #endif
41 51
42 ngx_queue_init(&h3c->blocked); 52 ngx_queue_init(&h3c->blocked);
43 ngx_queue_init(&h3c->pushing); 53 ngx_queue_init(&h3c->pushing);
44 54
45 h3c->keepalive.log = pc->log; 55 h3c->keepalive.log = pc->log;
58 68
59 cln->handler = ngx_http_v3_cleanup_session; 69 cln->handler = ngx_http_v3_cleanup_session;
60 cln->data = h3c; 70 cln->data = h3c;
61 71
62 hc->v3_session = h3c; 72 hc->v3_session = h3c;
73
74 #if (NGX_HTTP_V3_HQ)
75 if (h3c->hq) {
76 return NGX_OK;
77 }
78 #endif
63 79
64 return ngx_http_v3_send_settings(c); 80 return ngx_http_v3_send_settings(c);
65 81
66 failed: 82 failed:
67 83