From 3d60d71ad29712a74a1651095200db622c353b98 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sun, 30 Oct 2005 09:53:15 +0000 Subject: [PATCH] Partial fix for ITS#3850, stop spurious "deferring: binding" messages. Make sure conn state is reset before reply reaches client. Hang still occurs in RE22, not in RE23. --- servers/slapd/connection.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 385186f882..bc2a9813a4 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -1333,14 +1333,6 @@ operations_error: connection_closing( conn, tag == LDAP_REQ_UNBIND ? NULL : "operations error" ); break; - - case LDAP_REQ_BIND: - conn->c_sasl_bind_in_progress = - rc == LDAP_SASL_BIND_IN_PROGRESS ? 1 : 0; - - if( conn->c_conn_state == SLAP_C_BINDING) { - conn->c_conn_state = SLAP_C_ACTIVE; - } } connection_resched( conn ); @@ -1978,12 +1970,28 @@ connection_init_log_prefix( Operation *op ) } } +static int connection_bind_cb( Operation *op, SlapReply *rs ) +{ + slap_callback *cb = op->o_callback; + op->o_callback = cb->sc_next; + + ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex ); + op->o_conn->c_conn_state = SLAP_C_ACTIVE; + ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex ); + + return SLAP_CB_CONTINUE; +} + static void connection_op_queue( Operation *op ) { int status; ber_tag_t tag = op->o_tag; if (tag == LDAP_REQ_BIND) { + slap_callback *sc = ch_calloc( 1, sizeof( slap_callback )); + sc->sc_response = connection_bind_cb; + sc->sc_next = op->o_callback; + op->o_callback = sc; op->o_conn->c_conn_state = SLAP_C_BINDING; } -- 2.39.5