Mercurial > hg > nginx
changeset 1377:0d57c150115b
set default listen() backlog to 511 on all platforms except FreeBSD
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 09 Aug 2007 13:32:21 +0000 |
parents | 6ff8c0c1e194 |
children | 0be898896d1a |
files | 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 |
diffstat | 8 files changed, 19 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/core/ngx_connection.c Tue Aug 07 12:34:20 2007 +0000 +++ b/src/core/ngx_connection.c Thu Aug 09 13:32:21 2007 +0000 @@ -123,7 +123,7 @@ ntohs(sin->sin_port)) - ls[i].addr_text.data; - ls[i].backlog = -1; + ls[i].backlog = NGX_LISTEN_BACKLOG; olen = sizeof(int);
--- a/src/http/ngx_http_core_module.c Tue Aug 07 12:34:20 2007 +0000 +++ b/src/http/ngx_http_core_module.c Thu Aug 09 13:32:21 2007 +0000 @@ -2219,7 +2219,7 @@ #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 @@ 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;
--- a/src/mail/ngx_mail.c Tue Aug 07 12:34:20 2007 +0000 +++ b/src/mail/ngx_mail.c Thu Aug 09 13:32:21 2007 +0000 @@ -300,7 +300,7 @@ return NGX_CONF_ERROR; } - ls->backlog = -1; + ls->backlog = NGX_LISTEN_BACKLOG; ls->rcvbuf = -1; ls->sndbuf = -1;
--- a/src/os/unix/ngx_freebsd_config.h Tue Aug 07 12:34:20 2007 +0000 +++ b/src/os/unix/ngx_freebsd_config.h Thu Aug 09 13:32:21 2007 +0000 @@ -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
--- a/src/os/unix/ngx_linux_config.h Tue Aug 07 12:34:20 2007 +0000 +++ b/src/os/unix/ngx_linux_config.h Thu Aug 09 13:32:21 2007 +0000 @@ -78,6 +78,9 @@ #endif +#define NGX_LISTEN_BACKLOG 511 + + #if defined TCP_DEFER_ACCEPT && !defined NGX_HAVE_DEFERRED_ACCEPT #define NGX_HAVE_DEFERRED_ACCEPT 1 #endif
--- a/src/os/unix/ngx_posix_config.h Tue Aug 07 12:34:20 2007 +0000 +++ b/src/os/unix/ngx_posix_config.h Thu Aug 09 13:32:21 2007 +0000 @@ -88,6 +88,9 @@ #endif +#define NGX_LISTEN_BACKLOG 511 + + #if (__FreeBSD__) && (__FreeBSD_version < 400017) #include <sys/param.h> /* ALIGN() */
--- a/src/os/unix/ngx_solaris_config.h Tue Aug 07 12:34:20 2007 +0000 +++ b/src/os/unix/ngx_solaris_config.h Thu Aug 09 13:32:21 2007 +0000 @@ -82,6 +82,9 @@ #endif +#define NGX_LISTEN_BACKLOG 511 + + #ifndef NGX_HAVE_INHERITED_NONBLOCK #define NGX_HAVE_INHERITED_NONBLOCK 1 #endif
--- a/src/os/win32/ngx_win32_config.h Tue Aug 07 12:34:20 2007 +0000 +++ b/src/os/win32/ngx_win32_config.h Thu Aug 09 13:32:21 2007 +0000 @@ -149,6 +149,9 @@ #define NGX_WIN_NT 200000 +#define NGX_LISTEN_BACKLOG 511 + + #ifndef NGX_HAVE_INHERITED_NONBLOCK #define NGX_HAVE_INHERITED_NONBLOCK 1 #endif