diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2003-07-10 14:04:33 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2003-07-10 14:04:33 +0000 |
commit | 3dc93a42432cbf6e40d4ac3a4e61152d86a9f7dd (patch) | |
tree | 94759075f2517f8126dbc628e66ea7d5bda03526 /nanohttp.c | |
parent | df101d832da9db9efd59ab194b18ccc5a7274bd1 (diff) | |
download | libxml2-3dc93a42432cbf6e40d4ac3a4e61152d86a9f7dd.tar.gz |
cleanup patches from Peter Breitenlohner Daniel
* nanoftp.c nanohttp.c: cleanup patches from Peter Breitenlohner
Daniel
Diffstat (limited to 'nanohttp.c')
-rw-r--r-- | nanohttp.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -996,14 +996,13 @@ xmlNanoHTTPConnectHost(const char *host, int port) } for (res = result; res; res = res->ai_next) { - if (res) { + if (res->ai_family == AF_INET || res->ai_family == AF_INET6) { if (res->ai_family == AF_INET6) { memcpy (&sockin6, res->ai_addr, res->ai_addrlen); sockin6.sin6_port = htons (port); addr = (struct sockaddr *)&sockin6; } - - if (res->ai_family == AF_INET) { + else { memcpy (&sockin, res->ai_addr, res->ai_addrlen); sockin.sin_port = htons (port); addr = (struct sockaddr *)&sockin; @@ -1015,11 +1014,10 @@ xmlNanoHTTPConnectHost(const char *host, int port) return (s); } } - else { - freeaddrinfo (result); - return (-1); - } } + if (result) + freeaddrinfo (result); + return (-1); } else #endif #endif |