mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 17:28:29 +00:00
Resolve #1131
This commit is contained in:
parent
9639578c2a
commit
cec6288a99
1 changed files with 5 additions and 1 deletions
|
@ -95,6 +95,10 @@
|
||||||
#define CPPHTTPLIB_SEND_FLAGS 0
|
#define CPPHTTPLIB_SEND_FLAGS 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef CPPHTTPLIB_LISTEN_BACKLOG
|
||||||
|
#define CPPHTTPLIB_LISTEN_BACKLOG 5
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Headers
|
* 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<socklen_t>(ai.ai_addrlen))) {
|
if (::bind(sock, ai.ai_addr, static_cast<socklen_t>(ai.ai_addrlen))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (::listen(sock, 5)) { // Listen through 5 channels
|
if (::listen(sock, CPPHTTPLIB_LISTEN_BACKLOG)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue