From: Eli Zaretskii Date: Fri, 17 May 2002 11:26:37 +0000 (+0000) Subject: (socket_connection): Move the code to resolve the POP X-Git-Tag: emacs-pretest-21.2.91~268 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=13e159653577cb01e97af8ee4b04cffc7c58bb01;p=emacs.git (socket_connection): Move the code to resolve the POP host right before trying to connect with it. --- diff --git a/lib-src/pop.c b/lib-src/pop.c index 1c2cc95ac68..fe2072cab4f 100644 --- a/lib-src/pop.c +++ b/lib-src/pop.c @@ -1054,17 +1054,6 @@ socket_connection (host, flags) } #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 @@ socket_connection (host, flags) } + 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,