]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Fix connections_shutdown()
authorHoward Chu <hyc@openldap.org>
Thu, 14 Dec 2006 02:12:39 +0000 (02:12 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 14 Dec 2006 02:12:39 +0000 (02:12 +0000)
servers/slapd/connection.c

index 86aea6ca177378301637e9ceb0d40499db942b78..7a46410ab55aac83e35ef20b7dab8911e2af10b7 100644 (file)
@@ -196,22 +196,19 @@ int connections_shutdown(void)
        ber_socket_t i;
 
        for ( i = 0; i < dtblsize; i++ ) {
-               if( connections[i].c_struct_state != SLAP_C_USED ) {
-                       continue;
-               }
-               /* give persistent clients a chance to cleanup */
-               if( connections[i].c_conn_state == SLAP_C_CLIENT ) {
-                       ldap_pvt_thread_pool_submit( &connection_pool,
-                       connections[i].c_clientfunc, connections[i].c_clientarg );
-                       continue;
-               }
-
                ldap_pvt_thread_mutex_lock( &connections[i].c_mutex );
-
-               /* c_mutex is locked */
-               connection_closing( &connections[i], "slapd shutdown" );
-               connection_close( &connections[i] );
-
+               if( connections[i].c_struct_state == SLAP_C_USED ) {
+
+                       /* give persistent clients a chance to cleanup */
+                       if( connections[i].c_conn_state == SLAP_C_CLIENT ) {
+                               ldap_pvt_thread_pool_submit( &connection_pool,
+                               connections[i].c_clientfunc, connections[i].c_clientarg );
+                       } else {
+                               /* c_mutex is locked */
+                               connection_closing( &connections[i], "slapd shutdown" );
+                               connection_close( &connections[i] );
+                       }
+               }
                ldap_pvt_thread_mutex_unlock( &connections[i].c_mutex );
        }