]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/connection.c
ITS#6152 bits.
[openldap] / servers / slapd / connection.c
index cb818a4a9edb6029fe7827928de8c8433098047e..897a50c3bc8a1138d12e9f8024b92854f5c0b5e0 100644 (file)
@@ -249,7 +249,7 @@ int connections_timeout_idle(time_t now)
                        i++;
                        continue;
                }
-               if ( c->c_writewaiter ) {
+               if ( c->c_writewaiter && global_writetimeout ) {
                        writers = 1;
                        if( difftime( c->c_activitytime+global_writetimeout, now) < 0 ) {
                                /* close it */
@@ -260,7 +260,7 @@ int connections_timeout_idle(time_t now)
                }
        }
        connection_done( c );
-       if ( !writers )
+       if ( old && !writers )
                slapd_clr_writetime( old );
 
        return i;
@@ -1127,6 +1127,9 @@ operations_error:
 
        ldap_pvt_thread_mutex_lock( &conn->c_mutex );
 
+       if ( opidx == SLAP_OP_BIND && conn->c_conn_state == SLAP_C_BINDING )
+               conn->c_conn_state = SLAP_C_ACTIVE;
+
        cancel = op->o_cancel;
        if ( cancel != SLAP_CANCEL_NONE && cancel != SLAP_CANCEL_DONE ) {
                if ( cancel == SLAP_CANCEL_REQ ) {
@@ -1534,6 +1537,9 @@ connection_input( Connection *conn , conn_readinfo *cri )
        ctx = cri->ctx;
        op = slap_op_alloc( ber, msgid, tag, conn->c_n_ops_received++, ctx );
 
+       Debug( LDAP_DEBUG_TRACE, "op tag 0x%lx, time %ld\n", tag,
+               (long) op->o_time, 0);
+
        op->o_conn = conn;
        /* clear state if the connection is being reused from inactive */
        if ( conn->c_conn_state == SLAP_C_INACTIVE ) {
@@ -1719,8 +1725,6 @@ static int connection_bind_cleanup_cb( Operation *op, SlapReply *rs )
 static int connection_bind_cb( Operation *op, SlapReply *rs )
 {
        ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
-       if ( op->o_conn->c_conn_state == SLAP_C_BINDING )
-               op->o_conn->c_conn_state = SLAP_C_ACTIVE;
        op->o_conn->c_sasl_bind_in_progress =
                ( rs->sr_err == LDAP_SASL_BIND_IN_PROGRESS );