Added better handling of getaddrinfo errors

This commit is contained in:
Kurt Zeilenga 2001-10-01 17:58:18 +00:00
parent 535134f6af
commit efd3da586d
2 changed files with 12 additions and 3 deletions

View file

@ -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

View file

@ -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;