]> git.sur5r.net Git - openldap/commitdiff
Fix unlock bug in connection_read/write. Fix connection_read() to
authorKurt Zeilenga <kurt@openldap.org>
Tue, 23 Mar 1999 01:57:48 +0000 (01:57 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 23 Mar 1999 01:57:48 +0000 (01:57 +0000)
ignore input when connection is closing.

servers/slapd/connection.c

index 5f88d1dc338f63e491addef56a3e7b48f5607418..aec09ae6905c2032bcc1d0edbd9512bed75d3bfc 100644 (file)
@@ -553,9 +553,20 @@ int connection_read(int s)
                Debug( LDAP_DEBUG_ANY,
                        "connection_read(%d): no connection!\n",
                        s, 0, 0 );
+               ldap_pvt_thread_mutex_unlock( &connections_mutex );
                return -1;
        }
 
+       if( c->c_conn_state == SLAP_C_CLOSING ) {
+               Debug( LDAP_DEBUG_TRACE,
+                       "connection_read(%d): closing, ignoring input for id=%ld\n",
+                       s, c->c_connid, 0 );
+
+               connection_return( c );
+               ldap_pvt_thread_mutex_unlock( &connections_mutex );
+               return 0;
+       }
+
        Debug( LDAP_DEBUG_TRACE,
                "connection_read(%d): checking for input on id=%ld\n",
                s, c->c_connid, 0 );
@@ -755,6 +766,7 @@ int connection_write(int s)
                Debug( LDAP_DEBUG_ANY,
                        "connection_write(%d): no connection!\n",
                        s, 0, 0 );
+               ldap_pvt_thread_mutex_unlock( &connections_mutex );
                return -1;
        }