summaryrefslogtreecommitdiff
path: root/nanohttp.c
diff options
context:
space:
mode:
authorMike Hommey <glandium@debian.org>2005-09-05 17:10:35 +0000
committerMike Hommey <glandium@debian.org>2005-09-05 17:10:35 +0000
commita464d9993e2acd5b8e1089b218ba74c6fcf215c5 (patch)
tree72fe00eb59147367a1d660b90d08172357e0dffc /nanohttp.c
parent112cb5bb5475afec1c1cbf1d6728ce4880d0fee8 (diff)
downloadlibxml2-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.c33
1 files changed, 28 insertions, 5 deletions
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);
@@ -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)) {