]> git.sur5r.net Git - openldap/commitdiff
Added better handling of getaddrinfo errors
authorKurt Zeilenga <kurt@openldap.org>
Mon, 1 Oct 2001 17:58:18 +0000 (17:58 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 1 Oct 2001 17:58:18 +0000 (17:58 +0000)
CHANGES
libraries/libldap/os-ip.c

diff --git a/CHANGES b/CHANGES
index 025dced24f4cacc6096ccecd34b70af94d6744a2..fc150670542aa84337e4b3285c4db1b5418451b5 100644 (file)
--- a/CHANGES
+++ b/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
index 79bd49af9fb7d9048a3091cd3e346dfdd80c4cc1..372d22ddfde05fa36a36cd8b29c70a24ac29a245 100644 (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;