libmicrohttpd

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

commit 6d210e7986375d208a75d3a7c82f799e34358645
parent 2eb0a5f92d7496e36bbdcb7c1c8ba1d3a829ced0
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Sat, 25 May 2019 15:15:03 +0300

Eliminated one compiler warning, checking is more correct now

Diffstat:
Msrc/microhttpd/daemon.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c @@ -4920,10 +4920,13 @@ parse_options_va (struct MHD_Daemon *daemon, case MHD_OPTION_CONNECTION_TIMEOUT: uv = va_arg (ap, unsigned int); + daemon->connection_timeout = (time_t)uv; /* Next comparison could be always false on some platforms and whole branch will * be optimized out on those platforms. On others it will be compiled into real * check. */ - if (TIME_T_MAX < uv) /* Compiler may warn on some platforms, ignore warning. */ + if ( ( (MHD_TYPE_IS_SIGNED_(time_t)) && + (daemon->connection_timeout < 0) ) || /* Compiler may warn on some platforms, ignore warning. */ + (uv != (unsigned int)daemon->connection_timeout) ) { #ifdef HAVE_MESSAGES MHD_DLOG (daemon, @@ -4931,8 +4934,6 @@ parse_options_va (struct MHD_Daemon *daemon, #endif daemon->connection_timeout = 0; } - else - daemon->connection_timeout = (time_t)uv; break; case MHD_OPTION_NOTIFY_COMPLETED: daemon->notify_completed = va_arg (ap,