From: Ondřej Kuzník Date: Wed, 2 Mar 2022 11:44:01 +0000 (+0000) Subject: ITS#9799 Drop a bind connection if there's a timeout X-Git-Tag: OPENLDAP_REL_ENG_2_5_13~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be8f7430e51cef4abff6808393ac4644fe6feea1;p=thirdparty%2Fopenldap.git ITS#9799 Drop a bind connection if there's a timeout --- diff --git a/servers/lloadd/operation.c b/servers/lloadd/operation.c index 4fdc190b97..9074404396 100644 --- a/servers/lloadd/operation.c +++ b/servers/lloadd/operation.c @@ -589,19 +589,20 @@ connection_timeout( LloadConnection *upstream, void *arg ) LDAP_ADMINLIMIT_EXCEEDED, "upstream did not respond in time", 0 ); - if ( rc == LDAP_SUCCESS ) { + if ( upstream->c_type != LLOAD_C_BIND && rc == LDAP_SUCCESS ) { rc = operation_send_abandon( op, upstream ); } operation_unlink( op ); } - /* TODO: if operation_send_abandon failed, we need to kill the upstream */ if ( rc == LDAP_SUCCESS ) { connection_write_cb( -1, 0, upstream ); } CONNECTION_LOCK(upstream); - if ( upstream->c_state == LLOAD_C_CLOSING && !upstream->c_ops ) { + /* ITS#9799: If a Bind timed out, connection is in an unknown state */ + if ( upstream->c_type == LLOAD_C_BIND || rc != LDAP_SUCCESS || + ( upstream->c_state == LLOAD_C_CLOSING && !upstream->c_ops ) ) { CONNECTION_DESTROY(upstream); } else { CONNECTION_UNLOCK(upstream);