libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 274b0c248e69e5b6bce8511e1d9a9445c1f6dfc8
parent b469d263d4b2151c74c37109f342862e64198476
Author: Christian Grothoff <christian@grothoff.org>
Date:   Thu,  2 Jun 2016 06:55:55 +0000

-fix branching, might have FD_CLR'ed -1 otherwise

Diffstat:
Msrc/microhttpd/connection.c | 18+++++++++---------
Msrc/microhttpd/daemon.c | 6+++---
2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c @@ -750,7 +750,7 @@ keepalive_possible (struct MHD_Connection *connection) /** - * Produce HTTP "Date:" header. + * Produce HTTP time stamp. * * @param date where to write the header, with * at least 128 bytes available space. @@ -788,14 +788,14 @@ get_date_string (char *date) now = *pNow; #endif sprintf (date, - "Date: %3s, %02u %3s %04u %02u:%02u:%02u GMT\r\n", - days[now.tm_wday % 7], - (unsigned int) now.tm_mday, - mons[now.tm_mon % 12], - (unsigned int) (1900 + now.tm_year), - (unsigned int) now.tm_hour, - (unsigned int) now.tm_min, - (unsigned int) now.tm_sec); + "Date: %3s, %02u %3s %04u %02u:%02u:%02u GMT\r\n", + days[now.tm_wday % 7], + (unsigned int) now.tm_mday, + mons[now.tm_mon % 12], + (unsigned int) (1900 + now.tm_year), + (unsigned int) now.tm_hour, + (unsigned int) now.tm_min, + (unsigned int) now.tm_sec); } diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c @@ -2443,10 +2443,10 @@ MHD_select (struct MHD_Daemon *daemon, we do not miss the shutdown, so only do this optimization if we have a shutdown signaling pipe. */ - if ( ( (MHD_INVALID_SOCKET != daemon->socket_fd) && - (daemon->connections == daemon->connection_limit) && + if ( (MHD_INVALID_SOCKET != daemon->socket_fd) && + ( ( (daemon->connections == daemon->connection_limit) && (0 != (daemon->options & MHD_USE_PIPE_FOR_SHUTDOWN)) ) || - (MHD_YES == daemon->at_limit) ) + (MHD_YES == daemon->at_limit) ) ) FD_CLR (daemon->socket_fd, &rs); } else