[nginx] svn commit: r4244 - in branches/stable-1.0: . auto src/core src/os/unix

igor at sysoev.ru igor at sysoev.ru
Tue Nov 1 11:25:15 UTC 2011


Author: is
Date: 2011-11-01 11:25:15 +0000 (Tue, 01 Nov 2011)
New Revision: 4244

Modified:
   branches/stable-1.0/
   branches/stable-1.0/auto/unix
   branches/stable-1.0/src/core/ngx_connection.c
   branches/stable-1.0/src/os/unix/ngx_freebsd_config.h
   branches/stable-1.0/src/os/unix/ngx_linux_config.h
Log:
Merging r4017:

Move SO_ACCEPTFILTER and TCP_DEFER_ACCEPT checks into configure.

NetBSD 5.0+ has SO_ACCEPTFILTER support merged from FreeBSD, and having
accept filter check in FreeBSD-specific ngx_freebsd_config.h prevents it
from being used on NetBSD.  Therefore move the check into configure (and
do the same for Linux-specific TCP_DEFER_ACCEPT, just to be in line).



Property changes on: branches/stable-1.0
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk:3960-3974,3977-3987,3991-3996,3998,4003-4007,4009-4013,4015-4016,4018,4023,4025-4027,4035-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4131,4133,4135-4137,4154,4156-4157,4184,4192,4200-4205
   + /trunk:3960-3974,3977-3987,3991-3996,3998,4003-4007,4009-4013,4015-4018,4023,4025-4027,4035-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4131,4133,4135-4137,4154,4156-4157,4184,4192,4200-4205

Modified: branches/stable-1.0/auto/unix
===================================================================
--- branches/stable-1.0/auto/unix	2011-11-01 11:23:26 UTC (rev 4243)
+++ branches/stable-1.0/auto/unix	2011-11-01 11:25:15 UTC (rev 4244)
@@ -295,6 +295,7 @@
     fi
 fi
 
+
 ngx_feature="SO_SETFIB"
 ngx_feature_name="NGX_HAVE_SETFIB"
 ngx_feature_run=no
@@ -305,6 +306,28 @@
 . auto/feature
 
 
+ngx_feature="SO_ACCEPTFILTER"
+ngx_feature_name="NGX_HAVE_DEFERRED_ACCEPT"
+ngx_feature_run=no
+ngx_feature_incs="#include <sys/socket.h>"
+ngx_feature_path=
+ngx_feature_libs=
+ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_ACCEPTFILTER, NULL, 0)"
+. auto/feature
+
+
+ngx_feature="TCP_DEFER_ACCEPT"
+ngx_feature_name="NGX_HAVE_DEFERRED_ACCEPT"
+ngx_feature_run=no
+ngx_feature_incs="#include <sys/socket.h>
+                  #include <netinet/in.h>
+                  #include <netinet/tcp.h>"
+ngx_feature_path=
+ngx_feature_libs=
+ngx_feature_test="setsockopt(0, IPPROTO_TCP, TCP_DEFER_ACCEPT, NULL, 0)"
+. auto/feature
+
+
 ngx_feature="accept4()"
 ngx_feature_name="NGX_HAVE_ACCEPT4"
 ngx_feature_run=no

Modified: branches/stable-1.0/src/core/ngx_connection.c
===================================================================
--- branches/stable-1.0/src/core/ngx_connection.c	2011-11-01 11:23:26 UTC (rev 4243)
+++ branches/stable-1.0/src/core/ngx_connection.c	2011-11-01 11:25:15 UTC (rev 4244)
@@ -580,7 +580,7 @@
             {
                 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
                               "setsockopt(SO_ACCEPTFILTER, \"%s\") "
-                              " for %V failed, ignored",
+                              "for %V failed, ignored",
                               ls[i].accept_filter, &ls[i].addr_text);
                 continue;
             }

Modified: branches/stable-1.0/src/os/unix/ngx_freebsd_config.h
===================================================================
--- branches/stable-1.0/src/os/unix/ngx_freebsd_config.h	2011-11-01 11:23:26 UTC (rev 4243)
+++ branches/stable-1.0/src/os/unix/ngx_freebsd_config.h	2011-11-01 11:25:15 UTC (rev 4244)
@@ -92,11 +92,6 @@
 #define NGX_LISTEN_BACKLOG        -1
 
 
-#if (defined SO_ACCEPTFILTER && !defined NGX_HAVE_DEFERRED_ACCEPT)
-#define NGX_HAVE_DEFERRED_ACCEPT  1
-#endif
-
-
 #if (__FreeBSD_version < 430000 || __FreeBSD_version < 500012)
 
 pid_t rfork_thread(int flags, void *stack, int (*func)(void *arg), void *arg);

Modified: branches/stable-1.0/src/os/unix/ngx_linux_config.h
===================================================================
--- branches/stable-1.0/src/os/unix/ngx_linux_config.h	2011-11-01 11:23:26 UTC (rev 4243)
+++ branches/stable-1.0/src/os/unix/ngx_linux_config.h	2011-11-01 11:25:15 UTC (rev 4244)
@@ -96,11 +96,6 @@
 #define NGX_LISTEN_BACKLOG        511
 
 
-#if defined TCP_DEFER_ACCEPT && !defined NGX_HAVE_DEFERRED_ACCEPT
-#define NGX_HAVE_DEFERRED_ACCEPT  1
-#endif
-
-
 #ifndef NGX_HAVE_SO_SNDLOWAT
 /* setsockopt(SO_SNDLOWAT) returns ENOPROTOOPT */
 #define NGX_HAVE_SO_SNDLOWAT         0



More information about the nginx-devel mailing list