]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-meta/conn.c
Merge remote-tracking branch 'origin/mdb.master' into OPENLDAP_REL_ENG_2_4
[openldap] / servers / slapd / back-meta / conn.c
index 4c50f4b9759dbcdcb5845a2d01bd81d327f163a7..7e63fae89604e8b031dd868addb8bf5378b96c71 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1999-2012 The OpenLDAP Foundation.
+ * Copyright 1999-2013 The OpenLDAP Foundation.
  * Portions Copyright 2001-2003 Pierangelo Masarati.
  * Portions Copyright 1999-2003 Howard Chu.
  * All rights reserved.
@@ -421,6 +421,8 @@ retry_lock:;
        ldap_set_option( msc->msc_ld, LDAP_OPT_REFERRALS,
                META_BACK_TGT_CHASE_REFERRALS( mt ) ? LDAP_OPT_ON : LDAP_OPT_OFF );
 
+       slap_client_keepalive(msc->msc_ld, &mt->mt_tls.sb_keepalive);
+
 #ifdef HAVE_TLS
        if ( !is_ldaps ) {
                slap_bindconf *sb = NULL;
@@ -762,6 +764,7 @@ meta_back_retry(
 
                if ( rc == LDAP_SUCCESS ) {
                        quarantine = 0;
+                       LDAP_BACK_CONN_BINDING_SET( msc ); binding = 1;
                        rc = meta_back_single_dobind( op, rs, mcp, candidate,
                                sendok, mt->mt_nretries, 0 );
 
@@ -1179,8 +1182,8 @@ retry_lock:;
                                mc = NULL;
 
                        } else {
-                               if ( ( mi->mi_conn_ttl != 0 && op->o_time > mc->mc_create_time + mi->mi_conn_ttl )
-                                       || ( mi->mi_idle_timeout != 0 && op->o_time > mc->mc_time + mi->mi_idle_timeout ) )
+                               if ( mc->mc_refcnt == 0 && (( mi->mi_conn_ttl != 0 && op->o_time > mc->mc_create_time + mi->mi_conn_ttl )
+                                       || ( mi->mi_idle_timeout != 0 && op->o_time > mc->mc_time + mi->mi_idle_timeout )) )
                                {
 #if META_BACK_PRINT_CONNTREE > 0
                                        meta_back_print_conntree( mi,