parameterise the listen backlog in smbd and make it larger by default. A backlog...
authorAndrew Tridgell <tridge@samba.org>
Wed, 29 Oct 2003 04:58:48 +0000 (04:58 +0000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 29 Oct 2003 04:58:48 +0000 (04:58 +0000)
source/include/local.h
source/smbd/server.c

index 4c3c58e14fc3cac08c55eaf9fffe85e25d1b11ae..540365047a2b281a724cbd2e8a64b315f29ec5d7 100644 (file)
 /* Buffer size to use when printing backtraces */
 #define BACKTRACE_STACK_SIZE 64
 
+/* size of listen() backlog in smbd */
+#define SMBD_LISTEN_BACKLOG 50
+
 #endif
index 8b890549ea34595b122e727fdedcd1f88f1f83e3..af39bcb757d601a01b5a63c9a3d046d23d7750fb 100644 (file)
@@ -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);