diff options
author | Mike Hommey <glandium@debian.org> | 2005-09-05 17:10:35 +0000 |
---|---|---|
committer | Mike Hommey <glandium@debian.org> | 2005-09-05 17:10:35 +0000 |
commit | a464d9993e2acd5b8e1089b218ba74c6fcf215c5 (patch) | |
tree | 72fe00eb59147367a1d660b90d08172357e0dffc /nanohttp.c | |
parent | 112cb5bb5475afec1c1cbf1d6728ce4880d0fee8 (diff) | |
download | libxml2-a464d9993e2acd5b8e1089b218ba74c6fcf215c5.tar.gz |
Load /usr/tmp/tmp.CMoFff/libxml2-2.6.21 intoupstream/2.6.21
packages/libxml2/branches/upstream/current.
Diffstat (limited to 'nanohttp.c')
-rw-r--r-- | nanohttp.c | 33 |
1 files changed, 28 insertions, 5 deletions
@@ -248,8 +248,10 @@ done: void xmlNanoHTTPCleanup(void) { - if (proxy != NULL) + if (proxy != NULL) { xmlFree(proxy); + proxy = NULL; + } #ifdef _WINSOCKAPI_ if (initialized) WSACleanup(); @@ -291,7 +293,7 @@ xmlNanoHTTPScanURL(xmlNanoHTTPCtxtPtr ctxt, const char *URL) { } if (URL == NULL) return; - uri = xmlParseURI(URL); + uri = xmlParseURIRaw(URL, 1); if (uri == NULL) return; @@ -344,7 +346,7 @@ xmlNanoHTTPScanProxy(const char *URL) { #endif if (URL == NULL) return; - uri = xmlParseURI(URL); + uri = xmlParseURIRaw(URL, 1); if ((uri == NULL) || (uri->scheme == NULL) || (strcmp(uri->scheme, "http")) || (uri->server == NULL)) { __xmlIOErr(XML_FROM_HTTP, XML_HTTP_URL_SYNTAX, "Syntax Error\n"); @@ -460,7 +462,14 @@ xmlNanoHTTPSend(xmlNanoHTTPCtxtPtr ctxt, const char * xmt_ptr, int outlen) { tv.tv_sec = timeout; tv.tv_usec = 0; FD_ZERO( &wfd ); +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable: 4018) +#endif FD_SET( ctxt->fd, &wfd ); +#ifdef _MSC_VER +#pragma warning(pop) +#endif (void)select( ctxt->fd + 1, NULL, &wfd, NULL, &tv ); } } @@ -553,7 +562,14 @@ xmlNanoHTTPRecv(xmlNanoHTTPCtxtPtr ctxt) { tv.tv_sec = timeout; tv.tv_usec = 0; FD_ZERO(&rfd); +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable: 4018) +#endif FD_SET(ctxt->fd, &rfd); +#ifdef _MSC_VER +#pragma warning(pop) +#endif if ( (select(ctxt->fd+1, &rfd, NULL, NULL, &tv)<1) #if defined(EINTR) @@ -839,7 +855,11 @@ xmlNanoHTTPConnectAttempt(struct sockaddr *addr) tv.tv_sec = timeout; tv.tv_usec = 0; - + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable: 4018) +#endif FD_ZERO(&wfd); FD_SET(s, &wfd); @@ -851,6 +871,9 @@ xmlNanoHTTPConnectAttempt(struct sockaddr *addr) #else switch(select(s+1, NULL, &wfd, NULL, &tv)) #endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif { case 0: /* Time out */ @@ -1034,7 +1057,7 @@ xmlNanoHTTPConnectHost(const char *host, int port) memcpy (&ia, h->h_addr_list[i], h->h_length); sockin.sin_family = h->h_addrtype; sockin.sin_addr = ia; - sockin.sin_port = htons (port); + sockin.sin_port = (u_short)htons ((unsigned short)port); addr = (struct sockaddr *) &sockin; #ifdef SUPPORT_IP6 } else if (have_ipv6 () && (h->h_addrtype == AF_INET6)) { |