From a464d9993e2acd5b8e1089b218ba74c6fcf215c5 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Mon, 5 Sep 2005 17:10:35 +0000 Subject: Load /usr/tmp/tmp.CMoFff/libxml2-2.6.21 into packages/libxml2/branches/upstream/current. --- nanohttp.c | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'nanohttp.c') diff --git a/nanohttp.c b/nanohttp.c index de89ab7..1244fe7 100644 --- a/nanohttp.c +++ b/nanohttp.c @@ -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); @@ -850,6 +870,9 @@ xmlNanoHTTPConnectAttempt(struct sockaddr *addr) switch(select(s+1, NULL, &wfd, &xfd, &tv)) #else switch(select(s+1, NULL, &wfd, NULL, &tv)) +#endif +#ifdef _MSC_VER +#pragma warning(pop) #endif { case 0: @@ -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)) { -- cgit v1.2.3