]> git.kaiwu.me - nginx.git/commitdiff
r1378 merge:
authorIgor Sysoev <igor@sysoev.ru>
Sat, 22 Sep 2007 18:59:05 +0000 (18:59 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Sat, 22 Sep 2007 18:59:05 +0000 (18:59 +0000)
set default listen() backlog to 511 on all platforms except FreeBSD

src/core/ngx_connection.c
src/http/ngx_http_core_module.c
src/mail/ngx_mail.c
src/os/unix/ngx_freebsd_config.h
src/os/unix/ngx_linux_config.h
src/os/unix/ngx_posix_config.h
src/os/unix/ngx_solaris_config.h
src/os/win32/ngx_win32_config.h

index 9d22ac60b934c540e52b022addc407fd62e2a234..87219f23635460f7ae47a3d2a8bace08bc3af394 100644 (file)
@@ -123,7 +123,7 @@ ngx_set_inherited_sockets(ngx_cycle_t *cycle)
                                           ntohs(sin->sin_port))
                               - ls[i].addr_text.data;
 
-        ls[i].backlog = -1;
+        ls[i].backlog = NGX_LISTEN_BACKLOG;
 
         olen = sizeof(int);
 
index 696c10b34ed4ed6d4fd99c8656863ae7d33cc34e..b2b0f3bca034feec69aa9f8e2a0e44e0a229d45c 100644 (file)
@@ -2226,7 +2226,7 @@ ngx_http_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
 #endif
         ls->family = AF_INET;
 
-        ls->conf.backlog = -1;
+        ls->conf.backlog = NGX_LISTEN_BACKLOG;
         ls->conf.rcvbuf = -1;
         ls->conf.sndbuf = -1;
     }
@@ -2577,7 +2577,7 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
     ls->port = u.port;
     ls->file_name = cf->conf_file->file.name;
     ls->line = cf->conf_file->line;
-    ls->conf.backlog = -1;
+    ls->conf.backlog = NGX_LISTEN_BACKLOG;
     ls->conf.rcvbuf = -1;
     ls->conf.sndbuf = -1;
 
index ec74e6f033e13037825d0a96f5b748e058a7a489..a39bec4a48176acaf49dfb3f91fb5e3261e218f8 100644 (file)
@@ -300,7 +300,7 @@ ngx_mail_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
                 return NGX_CONF_ERROR;
             }
 
-            ls->backlog = -1;
+            ls->backlog = NGX_LISTEN_BACKLOG;
             ls->rcvbuf = -1;
             ls->sndbuf = -1;
 
index a4e973dc38d7d9c82cd1463101ed0fd644704122..06cdb863ce99d4758be59da465bc2758cdcbb95b 100644 (file)
@@ -77,6 +77,9 @@
 #endif
 
 
+#define NGX_LISTEN_BACKLOG        -1
+
+
 #if (defined SO_ACCEPTFILTER && !defined NGX_HAVE_DEFERRED_ACCEPT)
 #define NGX_HAVE_DEFERRED_ACCEPT  1
 #endif
index 980e05d673347b2742a22ae02c7eed238ac82fca..3e0475ffc5a92e30cfe12b6f3426254532a3d2a9 100644 (file)
@@ -78,6 +78,9 @@ extern ssize_t sendfile(int s, int fd, int32_t *offset, size_t size);
 #endif
 
 
+#define NGX_LISTEN_BACKLOG        511
+
+
 #if defined TCP_DEFER_ACCEPT && !defined NGX_HAVE_DEFERRED_ACCEPT
 #define NGX_HAVE_DEFERRED_ACCEPT  1
 #endif
index 8a95099608e4dab36acf645deffc60c72ab5dd5d..f796576549d8ef04f2eef16bde3d0bdf096450cb 100644 (file)
@@ -88,6 +88,9 @@
 #endif
 
 
+#define NGX_LISTEN_BACKLOG  511
+
+
 #if (__FreeBSD__) && (__FreeBSD_version < 400017)
 
 #include <sys/param.h>          /* ALIGN() */
index 9183bb360714de1907c69b16ab7d6bbc542337cd..989a30e2c6374146d5f16e84d43ffe7874b9053a 100644 (file)
@@ -82,6 +82,9 @@
 #endif
 
 
+#define NGX_LISTEN_BACKLOG           511
+
+
 #ifndef NGX_HAVE_INHERITED_NONBLOCK
 #define NGX_HAVE_INHERITED_NONBLOCK  1
 #endif
index 6bdc57c08aa59faf18243df81ae55f329208092f..fcc89c3856f2fb61b4488e202d0db9fabcc0fef1 100644 (file)
@@ -148,6 +148,9 @@ typedef int                 sig_atomic_t;
 #define NGX_WIN_NT        200000
 
 
+#define NGX_LISTEN_BACKLOG           511
+
+
 #ifndef NGX_HAVE_INHERITED_NONBLOCK
 #define NGX_HAVE_INHERITED_NONBLOCK  1
 #endif