comparison src/http/v3/ngx_http_v3_filter_module.c @ 8780:557dc6a06ba6 quic

HTTP/3: fixed server push after 9ec3e71f8a61. When using server push, a segfault occured because ngx_http_v3_create_push_request() accessed ngx_http_v3_session_t object the old way. Prior to 9ec3e71f8a61, HTTP/3 session was stored directly in c->data. Now it's referenced by the v3_session field of ngx_http_connection_t.
author Roman Arutyunyan <arut@nginx.com>
date Tue, 18 May 2021 18:17:25 +0300
parents 67f0eb150047
children 1fec68e322d0
comparison
equal deleted inserted replaced
8779:f52a2b77d406 8780:557dc6a06ba6
835 { 835 {
836 ngx_pool_t *pool; 836 ngx_pool_t *pool;
837 ngx_connection_t *c, *pc; 837 ngx_connection_t *c, *pc;
838 ngx_http_request_t *r; 838 ngx_http_request_t *r;
839 ngx_http_log_ctx_t *ctx; 839 ngx_http_log_ctx_t *ctx;
840 ngx_http_connection_t *hc; 840 ngx_http_connection_t *hc, *phc;
841 ngx_http_v3_session_t *h3c;
842 ngx_http_core_srv_conf_t *cscf; 841 ngx_http_core_srv_conf_t *cscf;
843 842
844 pc = pr->connection; 843 pc = pr->connection;
845 844
846 r = NULL; 845 r = NULL;
856 hc = ngx_palloc(c->pool, sizeof(ngx_http_connection_t)); 855 hc = ngx_palloc(c->pool, sizeof(ngx_http_connection_t));
857 if (hc == NULL) { 856 if (hc == NULL) {
858 goto failed; 857 goto failed;
859 } 858 }
860 859
861 h3c = ngx_http_v3_get_session(c); 860 phc = ngx_http_quic_get_connection(pc);
862 ngx_memcpy(hc, h3c, sizeof(ngx_http_connection_t)); 861 ngx_memcpy(hc, phc, sizeof(ngx_http_connection_t));
863 c->data = hc; 862 c->data = hc;
864 863
865 ctx = ngx_palloc(c->pool, sizeof(ngx_http_log_ctx_t)); 864 ctx = ngx_palloc(c->pool, sizeof(ngx_http_log_ctx_t));
866 if (ctx == NULL) { 865 if (ctx == NULL) {
867 goto failed; 866 goto failed;