aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mail/ngx_mail.c2
-rw-r--r--src/mail/ngx_mail.h1
-rw-r--r--src/mail/ngx_mail_core_module.c14
3 files changed, 17 insertions, 0 deletions
diff --git a/src/mail/ngx_mail.c b/src/mail/ngx_mail.c
index 51b97f8d7..38664bc87 100644
--- a/src/mail/ngx_mail.c
+++ b/src/mail/ngx_mail.c
@@ -359,6 +359,8 @@ ngx_mail_optimize_servers(ngx_conf_t *cf, ngx_array_t *ports)
ls->log.data = &ls->addr_text;
ls->log.handler = ngx_accept_log_error;
+ ls->backlog = addr[i].opt.backlog;
+
ls->keepalive = addr[i].opt.so_keepalive;
#if (NGX_HAVE_KEEPALIVE_TUNABLE)
ls->keepidle = addr[i].opt.tcp_keepidle;
diff --git a/src/mail/ngx_mail.h b/src/mail/ngx_mail.h
index 534e89ff7..07d0cb60c 100644
--- a/src/mail/ngx_mail.h
+++ b/src/mail/ngx_mail.h
@@ -58,6 +58,7 @@ typedef struct {
int tcp_keepintvl;
int tcp_keepcnt;
#endif
+ int backlog;
} ngx_mail_listen_t;
diff --git a/src/mail/ngx_mail_core_module.c b/src/mail/ngx_mail_core_module.c
index 8f8dcd391..271afc473 100644
--- a/src/mail/ngx_mail_core_module.c
+++ b/src/mail/ngx_mail_core_module.c
@@ -383,6 +383,7 @@ ngx_mail_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ngx_memcpy(&ls->u.sockaddr, u.sockaddr, u.socklen);
ls->socklen = u.socklen;
+ ls->backlog = NGX_LISTEN_BACKLOG;
ls->wildcard = u.wildcard;
ls->ctx = cf->ctx;
@@ -418,6 +419,19 @@ ngx_mail_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
continue;
}
+ if (ngx_strncmp(value[i].data, "backlog=", 8) == 0) {
+ ls->backlog = ngx_atoi(value[i].data + 8, value[i].len - 8);
+ ls->bind = 1;
+
+ if (ls->backlog == NGX_ERROR || ls->backlog == 0) {
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+ "invalid backlog \"%V\"", &value[i]);
+ return NGX_CONF_ERROR;
+ }
+
+ continue;
+ }
+
if (ngx_strncmp(value[i].data, "ipv6only=o", 10) == 0) {
#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
struct sockaddr *sa;