diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/microhttpd/connection.c | 2 | ||||
-rw-r--r-- | src/microhttpd/connection_https.c | 2 |
3 files changed, 6 insertions, 2 deletions
@@ -1,3 +1,7 @@ | |||
1 | Thu Mar 16 23:12:07 MSK 2017 | ||
2 | Idle connection should be disconnected *after* "timeout" number of | ||
3 | second, not *before* this number. -EG/VT | ||
4 | |||
1 | Thu Mar 16 22:31:54 MSK 2017 | 5 | Thu Mar 16 22:31:54 MSK 2017 |
2 | Unified update of last activity on connections. | 6 | Unified update of last activity on connections. |
3 | Update last activity only if something is really transmitted. | 7 | Update last activity only if something is really transmitted. |
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index a883e4d9..2b1c35da 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c | |||
@@ -3219,7 +3219,7 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) | |||
3219 | unsigned int timeout; | 3219 | unsigned int timeout; |
3220 | timeout = connection->connection_timeout; | 3220 | timeout = connection->connection_timeout; |
3221 | if ( (0 != timeout) && | 3221 | if ( (0 != timeout) && |
3222 | (timeout <= (MHD_monotonic_sec_counter() - connection->last_activity)) ) | 3222 | (timeout < (MHD_monotonic_sec_counter() - connection->last_activity)) ) |
3223 | { | 3223 | { |
3224 | MHD_connection_close_ (connection, | 3224 | MHD_connection_close_ (connection, |
3225 | MHD_REQUEST_TERMINATED_TIMEOUT_REACHED); | 3225 | MHD_REQUEST_TERMINATED_TIMEOUT_REACHED); |
diff --git a/src/microhttpd/connection_https.c b/src/microhttpd/connection_https.c index 2c5e2588..fe197f1d 100644 --- a/src/microhttpd/connection_https.c +++ b/src/microhttpd/connection_https.c | |||
@@ -155,7 +155,7 @@ MHD_tls_connection_handle_idle (struct MHD_Connection *connection) | |||
155 | } | 155 | } |
156 | timeout = connection->connection_timeout; | 156 | timeout = connection->connection_timeout; |
157 | if ( (timeout != 0) && | 157 | if ( (timeout != 0) && |
158 | (timeout <= (MHD_monotonic_sec_counter() - connection->last_activity))) | 158 | (timeout < (MHD_monotonic_sec_counter() - connection->last_activity))) |
159 | MHD_connection_close_ (connection, | 159 | MHD_connection_close_ (connection, |
160 | MHD_REQUEST_TERMINATED_TIMEOUT_REACHED); | 160 | MHD_REQUEST_TERMINATED_TIMEOUT_REACHED); |
161 | #ifdef EPOLL_SUPPORT | 161 | #ifdef EPOLL_SUPPORT |