]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldap/bind.c
added tcp keepalive support to back-ldap
[openldap] / servers / slapd / back-ldap / bind.c
index b099ae7df1b45176d1a0f5f49540813279325b55..45f228a2824c2a6145b94dd583db241449d4a8da 100644 (file)
@@ -2,7 +2,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 2000-2003 Pierangelo Masarati.
  * Portions Copyright 1999-2003 Howard Chu.
  * All rights reserved.
@@ -716,6 +716,9 @@ ldap_back_prepare_conn( ldapconn_t *lc, Operation *op, SlapReply *rs, ldap_back_
                ldap_set_option( ld, LDAP_OPT_NETWORK_TIMEOUT, (const void *)&tv );
        }
 
+       /* turn on network keepalive, if configured so */
+       slap_client_keepalive(ld, &li->li_tls.sb_keepalive); 
+
 #ifdef HAVE_TLS
        if ( LDAP_BACK_CONN_ISPRIV( lc ) ) {
                /* See "rationale" comment in ldap_back_getconn() */
@@ -1581,7 +1584,6 @@ retry:;
        rc = ldap_back_op_result( lc, op, rs, msgid,
                -1, ( sendok | LDAP_BACK_BINDING ) );
        if ( rc == LDAP_SUCCESS ) {
-               op->o_conn->c_authz_cookie = op->o_bd->be_private;
                LDAP_BACK_CONN_ISBOUND_SET( lc );
        }
 
@@ -2411,7 +2413,6 @@ ldap_back_proxy_authz_bind(
                                ber_bvreplace( &lc->lc_bound_ndn, &bv );
                        }
 #endif /* SLAP_AUTH_DN */
-                       op->o_conn->c_authz_cookie = op->o_bd->be_private;
                        LDAP_BACK_CONN_ISBOUND_SET( lc );
                        break;
 
@@ -2482,7 +2483,6 @@ ldap_back_proxy_authz_bind(
                 * so that referral chasing is attempted using the right
                 * identity */
                LDAP_BACK_CONN_ISBOUND_SET( lc );
-               op->o_conn->c_authz_cookie = op->o_bd->be_private;
                if ( !BER_BVISNULL( binddn ) ) {
                        ber_bvreplace( &lc->lc_bound_ndn, binddn );
                }