]> PatchyGit - patchyircd.git/commitdiff
use SOMAXCONN as the backlog
authorEgor <egor@patchysicp.xyz>
Tue, 17 May 2022 16:23:38 +0000 (19:23 +0300)
committerEgor <egor@patchysicp.xyz>
Tue, 17 May 2022 16:23:38 +0000 (19:23 +0300)
config.h
main.c

index 7b990e9..b64f021 100644 (file)
--- a/config.h
+++ b/config.h
@@ -1,6 +1,6 @@
 #define LISTENING_PORT 6667
 #define LISTENING_PORT_TLS 6697
-#define LISTENING_BACKLOG 10
+#define LISTENING_BACKLOG SOMAXCONN
 #define CLIENTS 30
 #define SUPPORT_IPV4
 #define SUPPORT_IPV6
diff --git a/main.c b/main.c
index df688ee..1a0e488 100644 (file)
--- a/main.c
+++ b/main.c
@@ -114,7 +114,7 @@ SOCKET create_listen_sock(int af, struct sockaddr *addr, size_t len)
                exit(EXIT_FAILURE);
        }
        // Listen to socket
-       if(listen(sock, LISTENING_BACKLOG) == -1) {
+       if(listen(sock, SOMAXCONN) == -1) {
                net_perror("ERROR LISTEN");
                exit(EXIT_FAILURE);
        }