(socket_connection): Move the code to resolve the POP

host right before trying to connect with it.
This commit is contained in:
Eli Zaretskii 2002-05-17 11:24:02 +00:00
parent 05b5446096
commit b72f3bcb37

View file

@ -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,