summaryrefslogtreecommitdiffhomepage
path: root/src/stream/ngx_stream_handler.c
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@nginx.com>2021-09-29 15:06:28 +0300
committerSergey Kandaurov <pluknet@nginx.com>2021-09-29 15:06:28 +0300
commit3c31d3f42129689c5d8837d94fad0e44db9129a8 (patch)
treeaab60c31d4bb1b3072ace5831dd0cdde12cd71e5 /src/stream/ngx_stream_handler.c
parentdab6035d68f3dd3f212393635c193c7aefea0d65 (diff)
downloadnginx-3c31d3f42129689c5d8837d94fad0e44db9129a8.tar.gz
nginx-3c31d3f42129689c5d8837d94fad0e44db9129a8.tar.bz2
Stream: fixed segfault when using SSL certificates with variables.
Similar to the previous change, a segmentation fault occurres when evaluating SSL certificates on a QUIC connection due to an uninitialized stream session. The fix is to adjust initializing the QUIC part of a connection until after it has session and variables initialized. Similarly, this appends logging error context for QUIC connections: - client 127.0.0.1:54749 connected to 127.0.0.1:8880 while handling frames - quic client timed out (60: Operation timed out) while handling quic input
Diffstat (limited to '')
-rw-r--r--src/stream/ngx_stream_handler.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/stream/ngx_stream_handler.c b/src/stream/ngx_stream_handler.c
index f9030335f..3b95bf812 100644
--- a/src/stream/ngx_stream_handler.c
+++ b/src/stream/ngx_stream_handler.c
@@ -115,23 +115,6 @@ ngx_stream_init_connection(ngx_connection_t *c)
}
}
-#if (NGX_STREAM_QUIC)
-
- if (addr_conf->quic) {
- ngx_quic_conf_t *qcf;
-
- if (c->quic == NULL) {
- c->log->connection = c->number;
-
- qcf = ngx_stream_get_module_srv_conf(addr_conf->ctx,
- ngx_stream_quic_module);
- ngx_quic_run(c, qcf);
- return;
- }
- }
-
-#endif
-
s = ngx_pcalloc(c->pool, sizeof(ngx_stream_session_t));
if (s == NULL) {
ngx_stream_close_connection(c);
@@ -194,6 +177,21 @@ ngx_stream_init_connection(ngx_connection_t *c)
s->start_sec = tp->sec;
s->start_msec = tp->msec;
+#if (NGX_STREAM_QUIC)
+
+ if (addr_conf->quic) {
+ ngx_quic_conf_t *qcf;
+
+ if (c->quic == NULL) {
+ qcf = ngx_stream_get_module_srv_conf(addr_conf->ctx,
+ ngx_stream_quic_module);
+ ngx_quic_run(c, qcf);
+ return;
+ }
+ }
+
+#endif
+
rev = c->read;
rev->handler = ngx_stream_session_handler;