]> git.sur5r.net Git - openldap/commitdiff
Fix prev commit - check for c_state == CLOSING first
authorHoward Chu <hyc@openldap.org>
Thu, 15 Jan 2009 21:31:58 +0000 (21:31 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 15 Jan 2009 21:31:58 +0000 (21:31 +0000)
servers/slapd/result.c

index b5c6b90f5f3d5086c0ca1f93e39692d49acf4de1..c9351fb47776d023eb0c7d1c2dc8bfe2e0dc9b58 100644 (file)
@@ -144,6 +144,10 @@ static long send_ldap_ber(
 
        /* write only one pdu at a time - wait til it's our turn */
        ldap_pvt_thread_mutex_lock( &conn->c_write1_mutex );
+       if ( connection_state_closing( conn )) {
+               ldap_pvt_thread_mutex_unlock( &conn->c_write1_mutex );
+               return 0;
+       }
        while ( conn->c_writers > 0 ) {
                ldap_pvt_thread_cond_wait( &conn->c_write1_cv, &conn->c_write1_mutex );
        }