MXS-1123: Fix connection_timeout causing constant disconnections

In a configuration with multiple services, one with connection_timeout and
others without it, the connections to non-connection_timeout services
would get immediately closed due to integer overflow.
This commit is contained in:
Markus Mäkelä
2017-02-06 23:03:57 +02:00
parent c0f5124f6f
commit e3bed424ea
2 changed files with 5 additions and 3 deletions

View File

@ -1025,7 +1025,9 @@ void process_idle_sessions()
while (all_session)
{
if (all_session->ses_is_in_use &&
all_session->service && all_session->client_dcb && all_session->client_dcb->state == DCB_STATE_POLLING &&
all_session->service && all_session->client_dcb &&
all_session->client_dcb->state == DCB_STATE_POLLING &&
all_session->service->conn_idle_timeout &&
hkheartbeat - all_session->client_dcb->last_read > all_session->service->conn_idle_timeout * 10)
{
dcb_close(all_session->client_dcb);