Open maru opened 6 years ago
When a connection timeout occurs (in normal_timeout_tail), MHD_connection_handle_idle is called, but the connection termination is not executed because in this condition:
https://github.com/maru/libmicrohttpd-http2/blob/e7dcdeb5b48197610aff8c65c0336a8c55f63892/src/microhttpd/connection.c#L3720-L3721
timeout is equal to (MHD_monotonic_sec_counter() - connection->last_activity).
(MHD_monotonic_sec_counter() - connection->last_activity)
However, the timeout event is fired multiple times until MHD_monotonic_sec_counter() counts one more second.
May be the < sign should be changed to <= ?
if ( (0 != timeout) && (timeout <= (MHD_monotonic_sec_counter() - connection->last_activity)) )
if ( (0 != timeout) &&
(timeout <= (MHD_monotonic_sec_counter() - connection->last_activity)) )
Fixed in https://github.com/maru/libmicrohttpd-http2/commit/4e65147b18b5f163462060cf81a5b8ac8353c7c9#diff-aa6c482c1fa5161ccc03823a364d4f63
When a connection timeout occurs (in normal_timeout_tail), MHD_connection_handle_idle is called, but the connection termination is not executed because in this condition:
https://github.com/maru/libmicrohttpd-http2/blob/e7dcdeb5b48197610aff8c65c0336a8c55f63892/src/microhttpd/connection.c#L3720-L3721
timeout is equal to
(MHD_monotonic_sec_counter() - connection->last_activity)
.However, the timeout event is fired multiple times until MHD_monotonic_sec_counter() counts one more second.
May be the < sign should be changed to <= ?
if ( (0 != timeout) &&
(timeout <= (MHD_monotonic_sec_counter() - connection->last_activity)) )