aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2007-08-09 13:32:21 +0000
committerIgor Sysoev <igor@sysoev.ru>2007-08-09 13:32:21 +0000
commit031a6e2906592b4f5bfa6f21eb2fe2d49478139c (patch)
tree67e14f14f15a761e0c4112b46886100ae07735d0
parent3625a458d9a29943aa7891296ef2dd3e9933f9a8 (diff)
downloadnginx-031a6e2906592b4f5bfa6f21eb2fe2d49478139c.tar.gz
nginx-031a6e2906592b4f5bfa6f21eb2fe2d49478139c.zip
set default listen() backlog to 511 on all platforms except FreeBSD
-rw-r--r--src/core/ngx_connection.c2
-rw-r--r--src/http/ngx_http_core_module.c4
-rw-r--r--src/mail/ngx_mail.c2
-rw-r--r--src/os/unix/ngx_freebsd_config.h3
-rw-r--r--src/os/unix/ngx_linux_config.h3
-rw-r--r--src/os/unix/ngx_posix_config.h3
-rw-r--r--src/os/unix/ngx_solaris_config.h3
-rw-r--r--src/os/win32/ngx_win32_config.h3
8 files changed, 19 insertions, 4 deletions
diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c
index 9d22ac60b..87219f236 100644
--- a/src/core/ngx_connection.c
+++ b/src/core/ngx_connection.c
@@ -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);
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 0e732cfe2..f8bd6b92c 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -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;
diff --git a/src/mail/ngx_mail.c b/src/mail/ngx_mail.c
index ec74e6f03..a39bec4a4 100644
--- a/src/mail/ngx_mail.c
+++ b/src/mail/ngx_mail.c
@@ -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;
diff --git a/src/os/unix/ngx_freebsd_config.h b/src/os/unix/ngx_freebsd_config.h
index 0bf4fd525..818e230ba 100644
--- a/src/os/unix/ngx_freebsd_config.h
+++ b/src/os/unix/ngx_freebsd_config.h
@@ -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
diff --git a/src/os/unix/ngx_linux_config.h b/src/os/unix/ngx_linux_config.h
index 980e05d67..3e0475ffc 100644
--- a/src/os/unix/ngx_linux_config.h
+++ b/src/os/unix/ngx_linux_config.h
@@ -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
diff --git a/src/os/unix/ngx_posix_config.h b/src/os/unix/ngx_posix_config.h
index 8a9509960..f79657654 100644
--- a/src/os/unix/ngx_posix_config.h
+++ b/src/os/unix/ngx_posix_config.h
@@ -88,6 +88,9 @@
#endif
+#define NGX_LISTEN_BACKLOG 511
+
+
#if (__FreeBSD__) && (__FreeBSD_version < 400017)
#include <sys/param.h> /* ALIGN() */
diff --git a/src/os/unix/ngx_solaris_config.h b/src/os/unix/ngx_solaris_config.h
index 9183bb360..989a30e2c 100644
--- a/src/os/unix/ngx_solaris_config.h
+++ b/src/os/unix/ngx_solaris_config.h
@@ -82,6 +82,9 @@
#endif
+#define NGX_LISTEN_BACKLOG 511
+
+
#ifndef NGX_HAVE_INHERITED_NONBLOCK
#define NGX_HAVE_INHERITED_NONBLOCK 1
#endif
diff --git a/src/os/win32/ngx_win32_config.h b/src/os/win32/ngx_win32_config.h
index ceb934982..9dc8ca8a4 100644
--- a/src/os/win32/ngx_win32_config.h
+++ b/src/os/win32/ngx_win32_config.h
@@ -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