summaryrefslogtreecommitdiff
path: root/lib-src/pop.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2002-05-17 11:24:02 +0000
committerEli Zaretskii <eliz@gnu.org>2002-05-17 11:24:02 +0000
commitb72f3bcb37812e85616dbdd835231a36f0a4d054 (patch)
tree7fac3899d4a1b01f55976aab0394b3d4779af40a /lib-src/pop.c
parent05b544609666863a4d407763c87f576356d6cd4e (diff)
downloademacs-b72f3bcb37812e85616dbdd835231a36f0a4d054.tar.gz
(socket_connection): Move the code to resolve the POP
host right before trying to connect with it.
Diffstat (limited to 'lib-src/pop.c')
-rw-r--r--lib-src/pop.c22
1 files 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,