diff options
author | David Shaw <[email protected]> | 2002-10-11 02:24:59 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2002-10-11 02:24:59 +0000 |
commit | 4849c0ab7b717e7fcf85ea00e45c50a8076c72a1 (patch) | |
tree | 4b37b674be5627d1a68e391d72a574966546f2f0 | |
parent | * gpgkeys_ldap.c (search_key, main): Make sure LDAP values are freed in (diff) | |
download | gnupg-4849c0ab7b717e7fcf85ea00e45c50a8076c72a1.tar.gz gnupg-4849c0ab7b717e7fcf85ea00e45c50a8076c72a1.zip |
* http.c (connect_server): Properly handle a single A record that fails
connect().
-rw-r--r-- | util/ChangeLog | 5 | ||||
-rw-r--r-- | util/http.c | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/util/ChangeLog b/util/ChangeLog index 142a3895b..26dbed6fe 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,8 @@ +2002-10-10 David Shaw <[email protected]> + + * http.c (connect_server): Properly handle a single A record that + fails connect(). + 2002-10-03 David Shaw <[email protected]> * logger.c (g10_log_warning, log_set_strict): Add new log_warning diff --git a/util/http.c b/util/http.c index 7f356bcbd..e76ab940c 100644 --- a/util/http.c +++ b/util/http.c @@ -770,17 +770,18 @@ connect_server( const char *server, ushort port ) /* Try all A records until one responds. TODO: do this on the MINGW32 side as well. */ - do + + while(host->h_addr_list[i]) { addr.sin_addr = *(struct in_addr*)host->h_addr_list[i]; + if(connect( sd, (struct sockaddr *)&addr, sizeof addr) == 0) break; i++; } - while(addr.sin_addr.s_addr!=0); - if(addr.sin_addr.s_addr==0) + if(host->h_addr_list[i]==0) { sock_close(sd); return -1; |