From bbb92d2b0ea6bc10c71bed62924bfc95c11172a5 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 29 Oct 2003 04:58:48 +0000 Subject: [PATCH] parameterise the listen backlog in smbd and make it larger by default. A backlog of 5 is way too small these days. --- source/include/local.h | 3 +++ source/smbd/server.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/source/include/local.h b/source/include/local.h index 4c3c58e14fc..540365047a2 100644 --- a/source/include/local.h +++ b/source/include/local.h @@ -227,4 +227,7 @@ /* Buffer size to use when printing backtraces */ #define BACKTRACE_STACK_SIZE 64 +/* size of listen() backlog in smbd */ +#define SMBD_LISTEN_BACKLOG 50 + #endif diff --git a/source/smbd/server.c b/source/smbd/server.c index 8b890549ea3..af39bcb757d 100644 --- a/source/smbd/server.c +++ b/source/smbd/server.c @@ -250,7 +250,7 @@ static BOOL open_sockets_smbd(BOOL is_daemon, BOOL interactive, const char *smb_ set_socket_options(s,"SO_KEEPALIVE"); set_socket_options(s,user_socket_options); - if (listen(s, 5) == -1) { + if (listen(s, SMBD_LISTEN_BACKLOG) == -1) { DEBUG(0,("listen: %s\n",strerror(errno))); close(s); return False; @@ -286,7 +286,7 @@ static BOOL open_sockets_smbd(BOOL is_daemon, BOOL interactive, const char *smb_ set_socket_options(s,"SO_KEEPALIVE"); set_socket_options(s,user_socket_options); - if (listen(s, 5) == -1) { + if (listen(s, SMBD_LISTEN_BACKLOG) == -1) { DEBUG(0,("open_sockets_smbd: listen: %s\n", strerror(errno))); close(s);