summaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/ngx_connection.c18
-rw-r--r--src/core/ngx_connection.h5
-rw-r--r--src/core/ngx_core.h4
3 files changed, 21 insertions, 6 deletions
diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c
index c082d0dac..21f9980f2 100644
--- a/src/core/ngx_connection.c
+++ b/src/core/ngx_connection.c
@@ -1034,6 +1034,12 @@ ngx_close_listening_sockets(ngx_cycle_t *cycle)
ls = cycle->listening.elts;
for (i = 0; i < cycle->listening.nelts; i++) {
+#if (NGX_QUIC)
+ if (ls[i].quic) {
+ continue;
+ }
+#endif
+
c = ls[i].connection;
if (c) {
@@ -1176,11 +1182,6 @@ ngx_close_connection(ngx_connection_t *c)
ngx_uint_t log_error, level;
ngx_socket_t fd;
- if (c->fd == (ngx_socket_t) -1) {
- ngx_log_error(NGX_LOG_ALERT, c->log, 0, "connection already closed");
- return;
- }
-
if (c->read->timer_set) {
ngx_del_timer(c->read);
}
@@ -1189,7 +1190,7 @@ ngx_close_connection(ngx_connection_t *c)
ngx_del_timer(c->write);
}
- if (!c->shared) {
+ if (!c->shared && c->fd != (ngx_socket_t) -1) {
if (ngx_del_conn) {
ngx_del_conn(c, NGX_CLOSE_EVENT);
@@ -1221,6 +1222,11 @@ ngx_close_connection(ngx_connection_t *c)
ngx_free_connection(c);
+ if (c->fd == (ngx_socket_t) -1) {
+ ngx_log_debug0(NGX_LOG_DEBUG_CORE, c->log, 0, "connection has no fd");
+ return;
+ }
+
fd = c->fd;
c->fd = (ngx_socket_t) -1;
diff --git a/src/core/ngx_connection.h b/src/core/ngx_connection.h
index ad6556d0c..edc1ccbc2 100644
--- a/src/core/ngx_connection.h
+++ b/src/core/ngx_connection.h
@@ -75,6 +75,7 @@ struct ngx_listening_s {
unsigned reuseport:1;
unsigned add_reuseport:1;
unsigned keepalive:2;
+ unsigned quic:1;
unsigned deferred_accept:1;
unsigned delete_deferred:1;
@@ -149,6 +150,10 @@ struct ngx_connection_s {
ngx_proxy_protocol_t *proxy_protocol;
+#if (NGX_QUIC || NGX_COMPAT)
+ ngx_quic_stream_t *quic;
+#endif
+
#if (NGX_SSL || NGX_COMPAT)
ngx_ssl_connection_t *ssl;
#endif
diff --git a/src/core/ngx_core.h b/src/core/ngx_core.h
index 7ecdca0cb..8e6c756c9 100644
--- a/src/core/ngx_core.h
+++ b/src/core/ngx_core.h
@@ -27,6 +27,7 @@ typedef struct ngx_connection_s ngx_connection_t;
typedef struct ngx_thread_task_s ngx_thread_task_t;
typedef struct ngx_ssl_s ngx_ssl_t;
typedef struct ngx_proxy_protocol_s ngx_proxy_protocol_t;
+typedef struct ngx_quic_stream_s ngx_quic_stream_t;
typedef struct ngx_ssl_connection_s ngx_ssl_connection_t;
typedef struct ngx_udp_connection_s ngx_udp_connection_t;
@@ -82,6 +83,9 @@ typedef void (*ngx_connection_handler_pt)(ngx_connection_t *c);
#include <ngx_resolver.h>
#if (NGX_OPENSSL)
#include <ngx_event_openssl.h>
+#if (NGX_OPENSSL_QUIC)
+#include <ngx_event_quic.h>
+#endif
#endif
#include <ngx_process_cycle.h>
#include <ngx_conf_file.h>