[PATCH] Core: apply missed options to sockets added during binary upgrade.

Piotr Sikora piotr at cloudflare.com
Thu Oct 24 21:22:05 UTC 2013


# HG changeset patch
# User Piotr Sikora <piotr at cloudflare.com>
# Date 1382649517 25200
#      Thu Oct 24 14:18:37 2013 -0700
# Node ID d8ee8ef5dcde554bf1d89d61912e6e6f3c5573f2
# Parent  e6a1623f87bc96d5ec62b6d77356aa47dbc60756
Core: apply missed options to sockets added during binary upgrade.

The accept_filter and deferred options were not applied to sockets
that were added to configuration during binary upgrade cycle.

Signed-off-by: Piotr Sikora <piotr at cloudflare.com>

diff -r e6a1623f87bc -r d8ee8ef5dcde src/core/ngx_cycle.c
--- a/src/core/ngx_cycle.c Mon Oct 21 18:20:32 2013 +0800
+++ b/src/core/ngx_cycle.c Thu Oct 24 14:18:37 2013 -0700
@@ -545,6 +545,16 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)

             if (nls[n].fd == (ngx_socket_t) -1) {
                 nls[n].open = 1;
+#if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER)
+                if (nls[n].accept_filter) {
+                    nls[n].add_deferred = 1;
+                }
+#endif
+#if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT)
+                if (nls[n].deferred_accept) {
+                    nls[n].add_deferred = 1;
+                }
+#endif
             }
         }



More information about the nginx-devel mailing list