X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-meta%2Fconn.c;h=7e63fae89604e8b031dd868addb8bf5378b96c71;hb=4a6adbf5896ae503831807443dd3d83c8813b35c;hp=4c50f4b9759dbcdcb5845a2d01bd81d327f163a7;hpb=8fe328dd518d02e8eea9f36068e13671c9cb8093;p=openldap diff --git a/servers/slapd/back-meta/conn.c b/servers/slapd/back-meta/conn.c index 4c50f4b975..7e63fae896 100644 --- a/servers/slapd/back-meta/conn.c +++ b/servers/slapd/back-meta/conn.c @@ -1,7 +1,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * 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,