Commit b72f3bcb authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

(socket_connection): Move the code to resolve the POP

host right before trying to connect with it.
parent 05b54460
......@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment