Skip to content
This repository was archived by the owner on Apr 30, 2025. It is now read-only.

Commit cec6288

Browse files
committed
Resolve yhirose#1131
1 parent 9639578 commit cec6288

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

httplib.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@
9595
#define CPPHTTPLIB_SEND_FLAGS 0
9696
#endif
9797

98+
#ifndef CPPHTTPLIB_LISTEN_BACKLOG
99+
#define CPPHTTPLIB_LISTEN_BACKLOG 5
100+
#endif
101+
98102
/*
99103
* Headers
100104
*/
@@ -5107,7 +5111,7 @@ Server::create_server_socket(const char *host, int port, int socket_flags,
51075111
if (::bind(sock, ai.ai_addr, static_cast<socklen_t>(ai.ai_addrlen))) {
51085112
return false;
51095113
}
5110-
if (::listen(sock, 5)) { // Listen through 5 channels
5114+
if (::listen(sock, CPPHTTPLIB_LISTEN_BACKLOG)) {
51115115
return false;
51125116
}
51135117
return true;

0 commit comments

Comments
 (0)