# HG changeset patch # User Eli Zaretskii # Date 1021634642 0 # Node ID cbcc456b9a766f863300627ec8e8ff6e47aecf42 # Parent a269061783317bb2f0a83c900a60653b90f7ac6d (socket_connection): Move the code to resolve the POP host right before trying to connect with it. diff -r a26906178331 -r cbcc456b9a76 lib-src/pop.c --- a/lib-src/pop.c Fri May 17 11:13:10 2002 +0000 +++ b/lib-src/pop.c Fri May 17 11:24:02 2002 +0000 @@ -1054,17 +1054,6 @@ } #endif - do - { - hostent = gethostbyname (host); - try_count++; - if ((! hostent) && ((h_errno != TRY_AGAIN) || (try_count == 5))) - { - strcpy (pop_error, "Could not determine POP server's address"); - return (-1); - } - } while (! hostent); - bzero ((char *) &addr, sizeof (addr)); addr.sin_family = AF_INET; @@ -1115,6 +1104,17 @@ } + do + { + hostent = gethostbyname (host); + try_count++; + if ((! hostent) && ((h_errno != TRY_AGAIN) || (try_count == 5))) + { + strcpy (pop_error, "Could not determine POP server's address"); + return (-1); + } + } while (! hostent); + while (*hostent->h_addr_list) { bcopy (*hostent->h_addr_list, (char *) &addr.sin_addr,