aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-06-02 09:25:39 +0000
committerChristian Grothoff <christian@grothoff.org>2016-06-02 09:25:39 +0000
commit69b9aa6513f6a0a83e2216f4caea586296ccb905 (patch)
treebbbb8fbc97c1cd112868b261b85c0f66cdffeac5 /src/microhttpd
parent3233e1386a02935196fef241843780c56ab7a5f5 (diff)
downloadlibmicrohttpd-69b9aa6513f6a0a83e2216f4caea586296ccb905.tar.gz
libmicrohttpd-69b9aa6513f6a0a83e2216f4caea586296ccb905.zip
-fix ftbfs
Diffstat (limited to 'src/microhttpd')
-rw-r--r--src/microhttpd/daemon.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 099ae8d4..fd8754ce 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -2068,12 +2068,12 @@ MHD_accept_connection (struct MHD_Daemon *daemon)
2068#endif /* ! USE_ACCEPT4 */ 2068#endif /* ! USE_ACCEPT4 */
2069 if ((MHD_INVALID_SOCKET == s) || (addrlen <= 0)) 2069 if ((MHD_INVALID_SOCKET == s) || (addrlen <= 0))
2070 { 2070 {
2071#ifdef HAVE_MESSAGES
2072 const int err = MHD_socket_errno_; 2071 const int err = MHD_socket_errno_;
2073 /* This could be a common occurance with multiple worker threads */ 2072 /* This could be a common occurance with multiple worker threads */
2074 if ( (EINVAL == err) && 2073 if ( (EINVAL == err) &&
2075 (MHD_INVALID_SOCKET == daemon->socket_fd) ) 2074 (MHD_INVALID_SOCKET == daemon->socket_fd) )
2076 return MHD_NO; /* can happen during shutdown */ 2075 return MHD_NO; /* can happen during shutdown */
2076#ifdef HAVE_MESSAGES
2077 if ((EAGAIN != err) && (EWOULDBLOCK != err)) 2077 if ((EAGAIN != err) && (EWOULDBLOCK != err))
2078 MHD_DLOG (daemon, 2078 MHD_DLOG (daemon,
2079 "Error accepting connection: %s\n", 2079 "Error accepting connection: %s\n",
@@ -2093,18 +2093,22 @@ MHD_accept_connection (struct MHD_Daemon *daemon)
2093 /* system/process out of resources */ 2093 /* system/process out of resources */
2094 if (0 == daemon->connections) 2094 if (0 == daemon->connections)
2095 { 2095 {
2096#ifdef HAVE_MESSAGES
2096 /* Not setting 'at_limit' flag, as there is no way it 2097 /* Not setting 'at_limit' flag, as there is no way it
2097 would ever be cleared. Instead trying to produce 2098 would ever be cleared. Instead trying to produce
2098 bit fat ugly warning. */ 2099 bit fat ugly warning. */
2099 MHD_DLOG (daemon, 2100 MHD_DLOG (daemon,
2100 "Hit process or system resource limit at FIRST connection. This is really bad as there is no sane way to proceed. Will try busy waiting for system resources to become magically available.\n"); 2101 "Hit process or system resource limit at FIRST connection. This is really bad as there is no sane way to proceed. Will try busy waiting for system resources to become magically available.\n");
2102#endif
2101 } 2103 }
2102 else 2104 else
2103 { 2105 {
2104 daemon->at_limit = MHD_YES; 2106 daemon->at_limit = MHD_YES;
2107#ifdef HAVE_MESSAGES
2105 MHD_DLOG (daemon, 2108 MHD_DLOG (daemon,
2106 "Hit process or system resource limit at %u connections, temporarily suspending accept(). Consider setting a lower MHD_OPTION_CONNECTION_LIMIT.\n", 2109 "Hit process or system resource limit at %u connections, temporarily suspending accept(). Consider setting a lower MHD_OPTION_CONNECTION_LIMIT.\n",
2107 (unsigned int) daemon->connections); 2110 (unsigned int) daemon->connections);
2111#endif
2108 } 2112 }
2109 } 2113 }
2110 return MHD_NO; 2114 return MHD_NO;