From b72f3bcb37812e85616dbdd835231a36f0a4d054 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 17 May 2002 11:24:02 +0000 Subject: [PATCH] (socket_connection): Move the code to resolve the POP host right before trying to connect with it. --- lib-src/pop.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib-src/pop.c b/lib-src/pop.c index e27d5821388..9ced4776095 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, -- 2.39.2