mirror of
https://github.com/nginx/nginx.git
synced 2025-06-08 02:02:38 +08:00
set default listen() backlog to 511 on all platforms except FreeBSD
This commit is contained in:
parent
3625a458d9
commit
031a6e2906
@ -123,7 +123,7 @@ ngx_set_inherited_sockets(ngx_cycle_t *cycle)
|
|||||||
ntohs(sin->sin_port))
|
ntohs(sin->sin_port))
|
||||||
- ls[i].addr_text.data;
|
- ls[i].addr_text.data;
|
||||||
|
|
||||||
ls[i].backlog = -1;
|
ls[i].backlog = NGX_LISTEN_BACKLOG;
|
||||||
|
|
||||||
olen = sizeof(int);
|
olen = sizeof(int);
|
||||||
|
|
||||||
|
@ -2219,7 +2219,7 @@ ngx_http_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
|
|||||||
#endif
|
#endif
|
||||||
ls->family = AF_INET;
|
ls->family = AF_INET;
|
||||||
|
|
||||||
ls->conf.backlog = -1;
|
ls->conf.backlog = NGX_LISTEN_BACKLOG;
|
||||||
ls->conf.rcvbuf = -1;
|
ls->conf.rcvbuf = -1;
|
||||||
ls->conf.sndbuf = -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->port = u.port;
|
||||||
ls->file_name = cf->conf_file->file.name;
|
ls->file_name = cf->conf_file->file.name;
|
||||||
ls->line = cf->conf_file->line;
|
ls->line = cf->conf_file->line;
|
||||||
ls->conf.backlog = -1;
|
ls->conf.backlog = NGX_LISTEN_BACKLOG;
|
||||||
ls->conf.rcvbuf = -1;
|
ls->conf.rcvbuf = -1;
|
||||||
ls->conf.sndbuf = -1;
|
ls->conf.sndbuf = -1;
|
||||||
|
|
||||||
|
@ -300,7 +300,7 @@ ngx_mail_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
return NGX_CONF_ERROR;
|
return NGX_CONF_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
ls->backlog = -1;
|
ls->backlog = NGX_LISTEN_BACKLOG;
|
||||||
ls->rcvbuf = -1;
|
ls->rcvbuf = -1;
|
||||||
ls->sndbuf = -1;
|
ls->sndbuf = -1;
|
||||||
|
|
||||||
|
@ -77,6 +77,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#define NGX_LISTEN_BACKLOG -1
|
||||||
|
|
||||||
|
|
||||||
#if (defined SO_ACCEPTFILTER && !defined NGX_HAVE_DEFERRED_ACCEPT)
|
#if (defined SO_ACCEPTFILTER && !defined NGX_HAVE_DEFERRED_ACCEPT)
|
||||||
#define NGX_HAVE_DEFERRED_ACCEPT 1
|
#define NGX_HAVE_DEFERRED_ACCEPT 1
|
||||||
#endif
|
#endif
|
||||||
|
@ -78,6 +78,9 @@ extern ssize_t sendfile(int s, int fd, int32_t *offset, size_t size);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#define NGX_LISTEN_BACKLOG 511
|
||||||
|
|
||||||
|
|
||||||
#if defined TCP_DEFER_ACCEPT && !defined NGX_HAVE_DEFERRED_ACCEPT
|
#if defined TCP_DEFER_ACCEPT && !defined NGX_HAVE_DEFERRED_ACCEPT
|
||||||
#define NGX_HAVE_DEFERRED_ACCEPT 1
|
#define NGX_HAVE_DEFERRED_ACCEPT 1
|
||||||
#endif
|
#endif
|
||||||
|
@ -88,6 +88,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#define NGX_LISTEN_BACKLOG 511
|
||||||
|
|
||||||
|
|
||||||
#if (__FreeBSD__) && (__FreeBSD_version < 400017)
|
#if (__FreeBSD__) && (__FreeBSD_version < 400017)
|
||||||
|
|
||||||
#include <sys/param.h> /* ALIGN() */
|
#include <sys/param.h> /* ALIGN() */
|
||||||
|
@ -82,6 +82,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#define NGX_LISTEN_BACKLOG 511
|
||||||
|
|
||||||
|
|
||||||
#ifndef NGX_HAVE_INHERITED_NONBLOCK
|
#ifndef NGX_HAVE_INHERITED_NONBLOCK
|
||||||
#define NGX_HAVE_INHERITED_NONBLOCK 1
|
#define NGX_HAVE_INHERITED_NONBLOCK 1
|
||||||
#endif
|
#endif
|
||||||
|
@ -149,6 +149,9 @@ typedef int sig_atomic_t;
|
|||||||
#define NGX_WIN_NT 200000
|
#define NGX_WIN_NT 200000
|
||||||
|
|
||||||
|
|
||||||
|
#define NGX_LISTEN_BACKLOG 511
|
||||||
|
|
||||||
|
|
||||||
#ifndef NGX_HAVE_INHERITED_NONBLOCK
|
#ifndef NGX_HAVE_INHERITED_NONBLOCK
|
||||||
#define NGX_HAVE_INHERITED_NONBLOCK 1
|
#define NGX_HAVE_INHERITED_NONBLOCK 1
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user