]> git.sur5r.net Git - openldap/commitdiff
dispose of connection when server down (related to ITS#5127)
authorPierangelo Masarati <ando@openldap.org>
Sat, 29 Sep 2007 11:24:39 +0000 (11:24 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 29 Sep 2007 11:24:39 +0000 (11:24 +0000)
libraries/libldap/result.c

index deb76220e2b434df1943e9d2ebbc365a9e19a2ca..0a20a818114d72d9e6df81bfa4d445728ce0a33d 100644 (file)
@@ -558,6 +558,14 @@ nextresp3:
                if ( sock_errno() == EAGAIN ) return LDAP_MSG_X_KEEP_LOOKING;
 #endif
                ld->ld_errno = LDAP_SERVER_DOWN;
+#ifdef LDAP_R_COMPILE
+               ldap_pvt_thread_mutex_lock( &ld->ld_req_mutex );
+#endif
+               ldap_free_connection( ld, lc, 1, 0 );
+#ifdef LDAP_R_COMPILE
+               ldap_pvt_thread_mutex_unlock( &ld->ld_req_mutex );
+#endif
+               lc = *lcp = NULL;
                return -1;
 
        default: