diff options
author | Aron Xu <aron@debian.org> | 2015-09-21 22:55:55 +0800 |
---|---|---|
committer | Aron Xu <aron@debian.org> | 2015-09-21 22:55:55 +0800 |
commit | e85cf827a804d9abf4cbf48af6394c49331de322 (patch) | |
tree | aab761b5168447ea51ad1a64c9e1594e48f84b12 /nanohttp.c | |
parent | 4b692ee8530176868e4832e30bdc4ba5bc145948 (diff) | |
download | libxml2-e85cf827a804d9abf4cbf48af6394c49331de322.tar.gz |
Revert "Merge tag 'upstream/2.9.1+dfsg1'"
This reverts commit 21ee18bdbc9a9d4500e12a1399d51c593b8b31d4, reversing
changes made to de338c1adfa336ddb5177ceb5c63bcd868a0ebc7.
Diffstat (limited to 'nanohttp.c')
-rw-r--r-- | nanohttp.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -461,7 +461,7 @@ xmlNanoHTTPSend(xmlNanoHTTPCtxtPtr ctxt, const char *xmt_ptr, int outlen) if ((ctxt->state & XML_NANO_HTTP_WRITE) && (xmt_ptr != NULL)) { while (total_sent < outlen) { - int nsent = send(ctxt->fd, xmt_ptr + total_sent, + int nsent = send(ctxt->fd, SEND_ARG2_CAST (xmt_ptr + total_sent), outlen - total_sent, 0); if (nsent > 0) @@ -1003,6 +1003,7 @@ xmlNanoHTTPConnectAttempt(struct sockaddr *addr) 0) { /* Solaris error code */ __xmlIOErr(XML_FROM_HTTP, 0, "getsockopt failed\n"); + closesocket(s); return INVALID_SOCKET; } #endif @@ -1121,7 +1122,7 @@ xmlNanoHTTPConnectHost(const char *host, int port) #endif #if !defined(HAVE_GETADDRINFO) || !defined(_WIN32) { - h = gethostbyname (host); + h = gethostbyname (GETHOSTBYNAME_ARG_CAST host); if (h == NULL) { /* @@ -1362,17 +1363,17 @@ xmlNanoHTTPMethodRedir(const char *URL, const char *method, const char *input, xmlNanoHTTPInit(); retry: - if (redirURL == NULL) + if (redirURL == NULL) { ctxt = xmlNanoHTTPNewCtxt(URL); - else { + if (ctxt == NULL) + return(NULL); + } else { ctxt = xmlNanoHTTPNewCtxt(redirURL); + if (ctxt == NULL) + return(NULL); ctxt->location = xmlMemStrdup(redirURL); } - if ( ctxt == NULL ) { - return ( NULL ); - } - if ((ctxt->protocol == NULL) || (strcmp(ctxt->protocol, "http"))) { __xmlIOErr(XML_FROM_HTTP, XML_HTTP_URL_SYNTAX, "Not a valid HTTP URI"); xmlNanoHTTPFreeCtxt(ctxt); |