(socket_connection): Move the code to resolve the POP
host right before trying to connect with it.
This commit is contained in:
parent
05b5446096
commit
b72f3bcb37
1 changed files with 11 additions and 11 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue