From a141e3badf77885bc81b335d71713da259ef9457 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 16 Apr 2005 02:56:46 +0000 Subject: [PATCH] enable use of asynchronous call to StartTLS --- servers/slapd/back-ldap/back-ldap.h | 3 +++ servers/slapd/back-ldap/bind.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/servers/slapd/back-ldap/back-ldap.h b/servers/slapd/back-ldap/back-ldap.h index 0c0e826bdd..0a14779929 100644 --- a/servers/slapd/back-ldap/back-ldap.h +++ b/servers/slapd/back-ldap/back-ldap.h @@ -113,6 +113,9 @@ typedef enum ldap_back_send_t { LDAP_BACK_SENDRESULT = (LDAP_BACK_SENDOK|LDAP_BACK_SENDERR) } ldap_back_send_t; +/* define to use asynchronous StartTLS */ +#define SLAP_STARTTLS_ASYNCHRONOUS + LDAP_END_DECL #include "proto-ldap.h" diff --git a/servers/slapd/back-ldap/bind.c b/servers/slapd/back-ldap/bind.c index 1371f865e7..12d9e6d147 100644 --- a/servers/slapd/back-ldap/bind.c +++ b/servers/slapd/back-ldap/bind.c @@ -251,7 +251,7 @@ ldap_back_prepare_conn( struct ldapconn **lcp, Operation *op, SlapReply *rs, lda if ( ( LDAP_BACK_USE_TLS( li ) || ( op->o_conn->c_is_tls && LDAP_BACK_PROPAGATE_TLS( li ) ) ) && !ldap_is_ldaps_url( li->url ) ) { -#if 1 +#ifdef SLAP_STARTTLS_ASYNCHRONOUS /* * use asynchronous StartTLS * in case, chase referral (not implemented yet) @@ -315,12 +315,12 @@ retry:; ldap_msgfree( res ); } } -#else +#else /* ! SLAP_STARTTLS_ASYNCHRONOUS */ /* * use synchronous StartTLS */ rs->sr_err = ldap_start_tls_s( ld, NULL, NULL ); -#endif +#endif /* ! SLAP_STARTTLS_ASYNCHRONOUS */ /* if StartTLS is requested, only attempt it if the URL * is not "ldaps://"; this may occur not only in case -- 2.39.5