]> git.sur5r.net Git - openldap/commitdiff
ITS#4667 fix assert in connection_next() for PENDING connections
authorHoward Chu <hyc@openldap.org>
Fri, 8 Sep 2006 23:30:31 +0000 (23:30 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 8 Sep 2006 23:30:31 +0000 (23:30 +0000)
servers/slapd/connection.c

index 367ddf209eb0aacec61ffc425de09f5a8f3f740f..f989d8ddaac734b09dccc83b63631f37553d3428 100644 (file)
@@ -914,6 +914,7 @@ Connection* connection_next( Connection *c, ber_socket_t *index )
 
        ldap_pvt_thread_mutex_lock( &connections_mutex );
        for(; *index < dtblsize; (*index)++) {
+               int c_struct;
                if( connections[*index].c_struct_state == SLAP_C_UNINITIALIZED ) {
                        assert( connections[*index].c_conn_state == SLAP_C_INVALID );
                        break;
@@ -936,7 +937,10 @@ Connection* connection_next( Connection *c, ber_socket_t *index )
                        break;
                }
 
-               assert( connections[*index].c_struct_state == SLAP_C_UNUSED );
+               c_struct = connections[*index].c_struct_state;
+               if ( c_struct == SLAP_C_PENDING )
+                       continue;
+               assert( c_struct == SLAP_C_UNUSED );
                assert( connections[*index].c_conn_state == SLAP_C_INVALID );
        }