]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#8957 - Fix ASYNC TLS
authorQuanah Gibson-Mount <quanah@openldap.org>
Thu, 31 Jan 2019 02:33:17 +0000 (02:33 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Thu, 31 Jan 2019 23:28:36 +0000 (23:28 +0000)
Fix ASYNC TLS by correctly handling a return code of -2 in addition to 0

libraries/libldap/open.c

index bb81d86a76c8085a9cef6e1d790303155b0d10fa..20b3dfcd4b7ef69b64daa8b8e2fb59b46d34b1ba 100644 (file)
@@ -489,7 +489,7 @@ ldap_int_open_connection(
 #endif
 
 #ifdef HAVE_TLS
-       if (rc == 0 && ( ld->ld_options.ldo_tls_mode == LDAP_OPT_X_TLS_HARD ||
+       if ((rc == 0 || rc == -2) && ( ld->ld_options.ldo_tls_mode == LDAP_OPT_X_TLS_HARD ||
                strcmp( srv->lud_scheme, "ldaps" ) == 0 ))
        {
                ++conn->lconn_refcnt;   /* avoid premature free */