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
}
}
-#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);
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;