From 063981a06d3d248bed0594dbf45478406e7357a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Kuzn=C3=ADk?= Date: Thu, 16 Nov 2017 14:50:10 +0000 Subject: [PATCH] Respond to timeout events properly --- servers/lloadd/connection.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/servers/lloadd/connection.c b/servers/lloadd/connection.c index 907bbe2aa5..2b1a43326e 100644 --- a/servers/lloadd/connection.c +++ b/servers/lloadd/connection.c @@ -161,6 +161,14 @@ connection_read_cb( evutil_socket_t s, short what, void *arg ) return; } + if ( what & EV_TIMEOUT ) { + Debug( LDAP_DEBUG_CONNS, "connection_read_cb: " + "connid=%lu, timeout reached, destroying\n", + c->c_connid ); + CONNECTION_DESTROY(c); + return; + } + Debug( LDAP_DEBUG_CONNS, "connection_read_cb: " "connection connid=%lu ready to read\n", c->c_connid ); @@ -246,6 +254,14 @@ connection_write_cb( evutil_socket_t s, short what, void *arg ) CONNECTION_UNLOCK(c); return; } + + if ( what & EV_TIMEOUT ) { + Debug( LDAP_DEBUG_CONNS, "connection_write_cb: " + "connid=%lu, timeout reached, destroying\n", + c->c_connid ); + CONNECTION_DESTROY(c); + return; + } CONNECTION_UNLOCK_INCREF(c); /* Before we acquire any locks */