summaryrefslogtreecommitdiffhomepage
path: root/src/core/ngx_connection.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2013-10-31 04:00:37 +0400
committerMaxim Dounin <mdounin@mdounin.ru>2013-10-31 04:00:37 +0400
commit0eee3b0bc5ff2d62d38488bae1e67172c868d0f7 (patch)
tree66adb97e277b897047895ed243246d3caaf035cb /src/core/ngx_connection.c
parent475832834bc1ddd53011fee737be51ac24fb2ce8 (diff)
downloadnginx-0eee3b0bc5ff2d62d38488bae1e67172c868d0f7.tar.gz
nginx-0eee3b0bc5ff2d62d38488bae1e67172c868d0f7.tar.bz2
Core: handling of getsockopt(TCP_DEFER_ACCEPT) failures.
Recent Linux versions started to return EOPNOTSUPP to getsockopt() calls on unix sockets, resulting in log pollution on binary upgrade. Such errors are silently ignored now.
Diffstat (limited to 'src/core/ngx_connection.c')
-rw-r--r--src/core/ngx_connection.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c
index 28bf6ba06..fbcd5f719 100644
--- a/src/core/ngx_connection.c
+++ b/src/core/ngx_connection.c
@@ -93,8 +93,10 @@ ngx_set_inherited_sockets(ngx_cycle_t *cycle)
ngx_uint_t i;
ngx_listening_t *ls;
socklen_t olen;
-#if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER)
+#if (NGX_HAVE_DEFERRED_ACCEPT)
ngx_err_t err;
+#endif
+#if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER)
struct accept_filter_arg af;
#endif
#if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT)
@@ -248,7 +250,13 @@ ngx_set_inherited_sockets(ngx_cycle_t *cycle)
if (getsockopt(ls[i].fd, IPPROTO_TCP, TCP_DEFER_ACCEPT, &timeout, &olen)
== -1)
{
- ngx_log_error(NGX_LOG_NOTICE, cycle->log, ngx_errno,
+ err = ngx_errno;
+
+ if (err == NGX_EOPNOTSUPP) {
+ continue;
+ }
+
+ ngx_log_error(NGX_LOG_NOTICE, cycle->log, err,
"getsockopt(TCP_DEFER_ACCEPT) for %V failed, ignored",
&ls[i].addr_text);
continue;