]> git.sur5r.net Git - openldap/commitdiff
refine previous commits (don't leave bindings around)
authorPierangelo Masarati <ando@openldap.org>
Fri, 12 May 2006 19:25:31 +0000 (19:25 +0000)
committerPierangelo Masarati <ando@openldap.org>
Fri, 12 May 2006 19:25:31 +0000 (19:25 +0000)
servers/slapd/back-meta/bind.c
servers/slapd/back-meta/search.c

index fd0539d7ad1b01fc682ffe34158bf9891afecc54..05609f267b29710fd804b76a0262aaadd0360018 100644 (file)
@@ -571,7 +571,9 @@ retry:;
                                                mt, mc, candidate,
                                                LDAP_BACK_CONN_ISPRIV( mc ),
                                                LDAP_BACK_DONTSEND );
-                                       LDAP_BACK_CONN_BINDING_SET( msc );
+                                       if ( rc == LDAP_SUCCESS ) {
+                                               LDAP_BACK_CONN_BINDING_SET( msc );
+                                       }
 
                                } else {
                                        /* can't do anything about it */
index 8e8699438de0e0731bc51333b92d3341edc7a852..bc0010b81f917f1e161d157d15fc99400c976a0d 100644 (file)
@@ -1229,6 +1229,16 @@ finish:;
                        continue;
                }
 
+               if ( mc ) {
+                       ldap_pvt_thread_mutex_lock( &mi->mi_conninfo.lai_mutex );
+                       if ( LDAP_BACK_CONN_BINDING( &mc->mc_conns[ i ] )
+                               && candidates[ i ].sr_msgid != META_MSGID_NEED_BIND )
+                       {
+                               LDAP_BACK_CONN_BINDING_CLEAR( &mc->mc_conns[ i ] );
+                       }
+                       ldap_pvt_thread_mutex_unlock( &mi->mi_conninfo.lai_mutex );
+               }
+
                if ( candidates[ i ].sr_matched ) {
                        free( (char *)candidates[ i ].sr_matched );
                        candidates[ i ].sr_matched = NULL;