mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-19 02:28:47 -05:00
Added better handling of getaddrinfo errors
This commit is contained in:
parent
535134f6af
commit
efd3da586d
2 changed files with 12 additions and 3 deletions
3
CHANGES
3
CHANGES
|
|
@ -7,7 +7,10 @@ OpenLDAP 2.0.16 Engineering
|
|||
Fixed slurpd server down reject fix (ITS#1183)
|
||||
Fixed -llber ber_realloc bug (ITS#1346)
|
||||
Removed -lldbm use of Berkeley CDB
|
||||
Updated slapd/-lldap getaddrinfo error detection
|
||||
Updated -lldap_r pthread stack size
|
||||
Build environment
|
||||
Updated ltconfig for MacOS X 10.1
|
||||
Updated slapd.conf with ACL example
|
||||
Updated pthread detection
|
||||
Adjust test 7 read/write ratio
|
||||
|
|
|
|||
|
|
@ -312,9 +312,15 @@ ldap_connect_to_host(LDAP *ld, Sockbuf *sb,
|
|||
AC_GAI_STRERROR(err), 0, 0);
|
||||
return -1;
|
||||
}
|
||||
sai = res;
|
||||
rc = -1;
|
||||
do {
|
||||
|
||||
for( sai=res; sai != NULL; sai=sai->ai_next) {
|
||||
if( sai->ai_addr == NULL ) {
|
||||
osip_debug(ld, "ldap_connect_to_host: getaddrinfo "
|
||||
"ai_addr is NULL?\n", 0, 0, 0);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* we assume AF_x and PF_x are equal for all x */
|
||||
s = ldap_int_socket( ld, sai->ai_family, SOCK_STREAM );
|
||||
if ( s == AC_SOCKET_INVALID ) {
|
||||
|
|
@ -353,7 +359,7 @@ ldap_connect_to_host(LDAP *ld, Sockbuf *sb,
|
|||
break;
|
||||
}
|
||||
ldap_pvt_close_socket(ld, s);
|
||||
} while ((sai = sai->ai_next) != NULL);
|
||||
}
|
||||
freeaddrinfo(res);
|
||||
return rc;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue