diff options
| author | Eli Zaretskii | 2002-05-17 11:24:02 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2002-05-17 11:24:02 +0000 |
| commit | b72f3bcb37812e85616dbdd835231a36f0a4d054 (patch) | |
| tree | 7fac3899d4a1b01f55976aab0394b3d4779af40a /lib-src/pop.c | |
| parent | 05b544609666863a4d407763c87f576356d6cd4e (diff) | |
| download | emacs-b72f3bcb37812e85616dbdd835231a36f0a4d054.tar.gz emacs-b72f3bcb37812e85616dbdd835231a36f0a4d054.zip | |
(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.c | 22 |
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) | |||
| 1054 | } | 1054 | } |
| 1055 | #endif | 1055 | #endif |
| 1056 | 1056 | ||
| 1057 | do | ||
| 1058 | { | ||
| 1059 | hostent = gethostbyname (host); | ||
| 1060 | try_count++; | ||
| 1061 | if ((! hostent) && ((h_errno != TRY_AGAIN) || (try_count == 5))) | ||
| 1062 | { | ||
| 1063 | strcpy (pop_error, "Could not determine POP server's address"); | ||
| 1064 | return (-1); | ||
| 1065 | } | ||
| 1066 | } while (! hostent); | ||
| 1067 | |||
| 1068 | bzero ((char *) &addr, sizeof (addr)); | 1057 | bzero ((char *) &addr, sizeof (addr)); |
| 1069 | addr.sin_family = AF_INET; | 1058 | addr.sin_family = AF_INET; |
| 1070 | 1059 | ||
| @@ -1115,6 +1104,17 @@ socket_connection (host, flags) | |||
| 1115 | 1104 | ||
| 1116 | } | 1105 | } |
| 1117 | 1106 | ||
| 1107 | do | ||
| 1108 | { | ||
| 1109 | hostent = gethostbyname (host); | ||
| 1110 | try_count++; | ||
| 1111 | if ((! hostent) && ((h_errno != TRY_AGAIN) || (try_count == 5))) | ||
| 1112 | { | ||
| 1113 | strcpy (pop_error, "Could not determine POP server's address"); | ||
| 1114 | return (-1); | ||
| 1115 | } | ||
| 1116 | } while (! hostent); | ||
| 1117 | |||
| 1118 | while (*hostent->h_addr_list) | 1118 | while (*hostent->h_addr_list) |
| 1119 | { | 1119 | { |
| 1120 | bcopy (*hostent->h_addr_list, (char *) &addr.sin_addr, | 1120 | bcopy (*hostent->h_addr_list, (char *) &addr.sin_addr, |