]> git.kaiwu.me - nginx.git/commitdiff
set default listen() backlog to 511 on all platforms except FreeBSD
authorIgor Sysoev <igor@sysoev.ru>
Thu, 9 Aug 2007 13:32:21 +0000 (13:32 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Thu, 9 Aug 2007 13:32:21 +0000 (13:32 +0000)
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 0e732cfe2ec0e6b2d80aa9f6f9735525cae537cd..f8bd6b92ce4eb8735ea97cc79979e460d6a1a913 100644 (file)
@@ -2219,7 +2219,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;
     }
@@ -2570,7 +2570,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 0bf4fd525824d5269541b8cfecb0c6a91d5aa34b..818e230ba01d0e4993f572b71ea44bbb2d245727 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 ceb934982a08a0e48ccfa36445ccd7ee7b0e614c..9dc8ca8a436fc00b7ba71ff1848794d956c20010 100644 (file)
@@ -149,6 +149,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