mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-29 04:09:31 +03:00
better, and check against overflow
This commit is contained in:
+3
-3
@@ -493,12 +493,12 @@ MHD_handle_connection (void *data)
|
||||
struct pollfd p;
|
||||
|
||||
timeout = con->daemon->connection_timeout;
|
||||
if (timeout == 0)
|
||||
timeout = -1; /* 'forever' */
|
||||
while ((!con->daemon->shutdown) && (con->socket_fd != -1)) {
|
||||
now = time (NULL);
|
||||
tv.tv_usec = 0;
|
||||
if (timeout > (now - con->last_activity))
|
||||
if ( ( (timeout > (now - con->last_activity)) &&
|
||||
(now > con->last_activity) ) ||
|
||||
(timeout == 0) )
|
||||
{
|
||||
/* in case we are missing the SIGALRM, keep going after
|
||||
at most 1s; see http://lists.gnu.org/archive/html/libmicrohttpd/2009-10/msg00013.html */
|
||||
|
||||
Reference in New Issue
Block a user