aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/ngx_connection.c')
-rw-r--r--src/core/ngx_connection.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c
index 29aacc035..572def263 100644
--- a/src/core/ngx_connection.c
+++ b/src/core/ngx_connection.c
@@ -210,6 +210,18 @@ ngx_set_inherited_sockets(ngx_cycle_t *cycle)
olen = sizeof(int);
+ if (getsockopt(ls[i].fd, SOL_SOCKET, SO_TYPE, (void *) &ls[i].type,
+ &olen)
+ == -1)
+ {
+ ngx_log_error(NGX_LOG_CRIT, cycle->log, ngx_socket_errno,
+ "getsockopt(SO_TYPE) %V failed", &ls[i].addr_text);
+ ls[i].ignore = 1;
+ continue;
+ }
+
+ olen = sizeof(int);
+
if (getsockopt(ls[i].fd, SOL_SOCKET, SO_RCVBUF, (void *) &ls[i].rcvbuf,
&olen)
== -1)
@@ -274,6 +286,10 @@ ngx_set_inherited_sockets(ngx_cycle_t *cycle)
#endif
+ if (ls[i].type != SOCK_STREAM) {
+ continue;
+ }
+
#if (NGX_HAVE_TCP_FASTOPEN)
olen = sizeof(int);