From: Ian Puleston Date: Thu, 16 Mar 2023 20:09:48 +0000 (-0700) Subject: ITS#10023 libldap: fix asynch connects X-Git-Tag: OPENLDAP_REL_ENG_2_5_15~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cfb435972a969d381536d98d30020c3d9063a5ba;p=thirdparty%2Fopenldap.git ITS#10023 libldap: fix asynch connects This is option #1 --- diff --git a/libraries/libldap/open.c b/libraries/libldap/open.c index deb8c2fe4a..bfdbb2575d 100644 --- a/libraries/libldap/open.c +++ b/libraries/libldap/open.c @@ -501,6 +501,11 @@ ldap_int_open_connection( if( proto == LDAP_PROTO_UDP ) return 0; #endif + if ( async && rc == -2) { + /* Need to let the connect complete asynchronously before we continue */ + return -2; + } + #ifdef HAVE_TLS if ((rc == 0 || rc == -2) && ( ld->ld_options.ldo_tls_mode == LDAP_OPT_X_TLS_HARD || strcmp( srv->lud_scheme, "ldaps" ) == 0 ))