libmicrohttpd

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

commit 605bb70bdec54203561a0ba5917c78e2848cc74c
parent ac82c4d331f864f2100db4c3ffce16a5c34042e7
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Thu, 16 Mar 2017 22:03:49 +0300

HTTPS connection: fixed double processing of timeout

Diffstat:
Msrc/microhttpd/connection_https.c | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/microhttpd/connection_https.c b/src/microhttpd/connection_https.c @@ -142,11 +142,6 @@ MHD_tls_connection_handle_idle (struct MHD_Connection *connection) #endif if (connection->suspended) return MHD_connection_handle_idle (connection); - timeout = connection->connection_timeout; - if ( (timeout != 0) && - (timeout <= (MHD_monotonic_sec_counter() - connection->last_activity))) - MHD_connection_close_ (connection, - MHD_REQUEST_TERMINATED_TIMEOUT_REACHED); switch (connection->state) { /* on newly created connections we might reach here before any reply has been received */ @@ -158,6 +153,11 @@ MHD_tls_connection_handle_idle (struct MHD_Connection *connection) default: return MHD_connection_handle_idle (connection); } + timeout = connection->connection_timeout; + if ( (timeout != 0) && + (timeout <= (MHD_monotonic_sec_counter() - connection->last_activity))) + MHD_connection_close_ (connection, + MHD_REQUEST_TERMINATED_TIMEOUT_REACHED); #ifdef EPOLL_SUPPORT return MHD_connection_epoll_update_ (connection); #else