]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#10023 libldap: fix asynch connects
authorIan Puleston <ipuleston@sonicwall.com>
Thu, 16 Mar 2023 20:09:48 +0000 (13:09 -0700)
committerQuanah Gibson-Mount <quanah@openldap.org>
Thu, 25 May 2023 19:05:03 +0000 (19:05 +0000)
This is option #1

libraries/libldap/open.c

index deb8c2fe4ae6f580ff93f731810852bff2da8b6a..bfdbb2575df19fe2625b59fe998edaf303049b03 100644 (file)
@@ -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 ))