Mercurial > emacs
changeset 45328:cbcc456b9a76
(socket_connection): Move the code to resolve the POP
host right before trying to connect with it.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Fri, 17 May 2002 11:24:02 +0000 |
parents | a26906178331 |
children | 56a080c7a714 |
files | lib-src/pop.c |
diffstat | 1 files changed, 11 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/lib-src/pop.c Fri May 17 11:13:10 2002 +0000 +++ b/lib-src/pop.c Fri May 17 11:24:02 2002 +0000 @@ -1054,17 +1054,6 @@ } #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 @@ } + 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,