From cec6288a99de90ce609c0ae279dc58530a3c14fc Mon Sep 17 00:00:00 2001 From: yhirose Date: Tue, 14 Dec 2021 07:58:21 -0500 Subject: [PATCH] Resolve #1131 --- httplib.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/httplib.h b/httplib.h index e3d28bf..946a833 100644 --- a/httplib.h +++ b/httplib.h @@ -95,6 +95,10 @@ #define CPPHTTPLIB_SEND_FLAGS 0 #endif +#ifndef CPPHTTPLIB_LISTEN_BACKLOG +#define CPPHTTPLIB_LISTEN_BACKLOG 5 +#endif + /* * Headers */ @@ -5107,7 +5111,7 @@ Server::create_server_socket(const char *host, int port, int socket_flags, if (::bind(sock, ai.ai_addr, static_cast(ai.ai_addrlen))) { return false; } - if (::listen(sock, 5)) { // Listen through 5 channels + if (::listen(sock, CPPHTTPLIB_LISTEN_BACKLOG)) { return false; } return true;