]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Respond to timeout events properly
authorOndřej Kuzník <ondra@mistotebe.net>
Thu, 16 Nov 2017 14:50:10 +0000 (14:50 +0000)
committerOndřej Kuzník <okuznik@symas.com>
Tue, 17 Nov 2020 17:58:14 +0000 (17:58 +0000)
servers/lloadd/connection.c

index 907bbe2aa54a74b6f043d0d62aeb9e823453b9a9..2b1a43326e4f15b979dbbea07cd0cc9070fe9ac3 100644 (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 */