Respond to timeout events properly

This commit is contained in:
Ondřej Kuzník 2017-11-16 14:50:10 +00:00 committed by Ondřej Kuzník
parent ccf75c96c4
commit 063981a06d

View file

@ -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 */