Module: wine Branch: master Commit: b6852f6bed4bbff6b7105acde04d1971256107eb URL: https://gitlab.winehq.org/wine/wine/-/commit/b6852f6bed4bbff6b7105acde04d197...
Author: Alexandre Julliard julliard@winehq.org Date: Sat Sep 30 13:50:45 2023 +0200
ldap: Import upstream release 2.5.16.
---
libs/ldap/libldap/init.c | 6 +++--- libs/ldap/libldap/open.c | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/libs/ldap/libldap/init.c b/libs/ldap/libldap/init.c index a94744b8dcf..a289bd4b8cf 100644 --- a/libs/ldap/libldap/init.c +++ b/libs/ldap/libldap/init.c @@ -96,9 +96,9 @@ static const struct ol_attribute { {0, ATTR_OPTION, "URI", NULL, LDAP_OPT_URI}, /* replaces HOST/PORT */ {0, ATTR_OPTION, "SOCKET_BIND_ADDRESSES", NULL, LDAP_OPT_SOCKET_BIND_ADDRESSES}, {0, ATTR_BOOL, "REFERRALS", NULL, LDAP_BOOL_REFERRALS}, - {0, ATTR_INT, "KEEPALIVE_IDLE", NULL, LDAP_OPT_X_KEEPALIVE_IDLE}, - {0, ATTR_INT, "KEEPALIVE_PROBES", NULL, LDAP_OPT_X_KEEPALIVE_PROBES}, - {0, ATTR_INT, "KEEPALIVE_INTERVAL", NULL, LDAP_OPT_X_KEEPALIVE_INTERVAL}, + {0, ATTR_OPT_INT, "KEEPALIVE_IDLE", NULL, LDAP_OPT_X_KEEPALIVE_IDLE}, + {0, ATTR_OPT_INT, "KEEPALIVE_PROBES", NULL, LDAP_OPT_X_KEEPALIVE_PROBES}, + {0, ATTR_OPT_INT, "KEEPALIVE_INTERVAL", NULL, LDAP_OPT_X_KEEPALIVE_INTERVAL},
#if 0 /* This should only be allowed via ldap_set_option(3) */ diff --git a/libs/ldap/libldap/open.c b/libs/ldap/libldap/open.c index db84a74d6ce..6656325a460 100644 --- a/libs/ldap/libldap/open.c +++ b/libs/ldap/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 )) @@ -585,9 +590,9 @@ ldap_open_internal_connection( LDAP **ldp, ber_socket_t *fdp ) /* Attach the passed socket as the *LDAP's connection */ c = ldap_new_connection( ld, NULL, 1, 0, NULL, 0, 0 ); if( c == NULL ) { + LDAP_MUTEX_UNLOCK( &ld->ld_conn_mutex ); ldap_unbind_ext( ld, NULL, NULL ); *ldp = NULL; - LDAP_MUTEX_UNLOCK( &ld->ld_conn_mutex ); return( LDAP_NO_MEMORY ); } ber_sockbuf_ctrl( c->lconn_sb, LBER_SB_OPT_SET_FD, fdp );