diff options
author | Raphaël Hertzog <hertzog@debian.org> | 2015-08-25 21:55:54 +0200 |
---|---|---|
committer | Raphaël Hertzog <hertzog@debian.org> | 2015-08-25 21:55:54 +0200 |
commit | 7300193becde71a344c8ac0973dc290fa24d800d (patch) | |
tree | 6490c364e7764294c209e536d42f3d31d23ebc0d /nanohttp.c | |
parent | 3871a83a5f0aebd8c00879eab14fe901c93dbfcf (diff) | |
download | libxml2-7300193becde71a344c8ac0973dc290fa24d800d.tar.gz |
Imported Upstream version 2.9.1+dfsg1
Diffstat (limited to 'nanohttp.c')
-rw-r--r-- | nanohttp.c | 17 |
1 files changed, 8 insertions, 9 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, SEND_ARG2_CAST (xmt_ptr + total_sent), + int nsent = send(ctxt->fd, xmt_ptr + total_sent, outlen - total_sent, 0); if (nsent > 0) @@ -1003,7 +1003,6 @@ xmlNanoHTTPConnectAttempt(struct sockaddr *addr) 0) { /* Solaris error code */ __xmlIOErr(XML_FROM_HTTP, 0, "getsockopt failed\n"); - closesocket(s); return INVALID_SOCKET; } #endif @@ -1122,7 +1121,7 @@ xmlNanoHTTPConnectHost(const char *host, int port) #endif #if !defined(HAVE_GETADDRINFO) || !defined(_WIN32) { - h = gethostbyname (GETHOSTBYNAME_ARG_CAST host); + h = gethostbyname (host); if (h == NULL) { /* @@ -1363,17 +1362,17 @@ xmlNanoHTTPMethodRedir(const char *URL, const char *method, const char *input, xmlNanoHTTPInit(); retry: - if (redirURL == NULL) { + if (redirURL == NULL) ctxt = xmlNanoHTTPNewCtxt(URL); - if (ctxt == NULL) - return(NULL); - } else { + 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); |