diff options
Diffstat (limited to 'nanohttp.c')
-rw-r--r-- | nanohttp.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -63,7 +63,7 @@ #ifdef HAVE_STRINGS_H #include <strings.h> #endif -#ifdef HAVE_ZLIB_H +#ifdef LIBXML_ZLIB_ENABLED #include <zlib.h> #endif @@ -145,7 +145,7 @@ typedef struct xmlNanoHTTPCtxt { char *authHeader; /* contents of {WWW,Proxy}-Authenticate header */ char *encoding; /* encoding extracted from the contentType */ char *mimeType; /* Mime-Type extracted from the contentType */ -#ifdef HAVE_ZLIB_H +#ifdef LIBXML_ZLIB_ENABLED z_stream *strm; /* Zlib stream object */ int usesGzip; /* "Content-Encoding: gzip" was detected */ #endif @@ -434,7 +434,7 @@ xmlNanoHTTPFreeCtxt(xmlNanoHTTPCtxtPtr ctxt) { if (ctxt->mimeType != NULL) xmlFree(ctxt->mimeType); if (ctxt->location != NULL) xmlFree(ctxt->location); if (ctxt->authHeader != NULL) xmlFree(ctxt->authHeader); -#ifdef HAVE_ZLIB_H +#ifdef LIBXML_ZLIB_ENABLED if (ctxt->strm != NULL) { inflateEnd(ctxt->strm); xmlFree(ctxt->strm); @@ -817,7 +817,7 @@ xmlNanoHTTPScanAnswer(xmlNanoHTTPCtxtPtr ctxt, const char *line) { if (ctxt->authHeader != NULL) xmlFree(ctxt->authHeader); ctxt->authHeader = xmlMemStrdup(cur); -#ifdef HAVE_ZLIB_H +#ifdef LIBXML_ZLIB_ENABLED } else if ( !xmlStrncasecmp( BAD_CAST line, BAD_CAST"Content-Encoding:", 17) ) { cur += 17; while ((*cur == ' ') || (*cur == '\t')) cur++; @@ -1273,7 +1273,7 @@ xmlNanoHTTPOpenRedir(const char *URL, char **contentType, char **redir) { int xmlNanoHTTPRead(void *ctx, void *dest, int len) { xmlNanoHTTPCtxtPtr ctxt = (xmlNanoHTTPCtxtPtr) ctx; -#ifdef HAVE_ZLIB_H +#ifdef LIBXML_ZLIB_ENABLED int bytes_read = 0; int orig_avail_in; int z_ret; @@ -1283,7 +1283,7 @@ xmlNanoHTTPRead(void *ctx, void *dest, int len) { if (dest == NULL) return(-1); if (len <= 0) return(0); -#ifdef HAVE_ZLIB_H +#ifdef LIBXML_ZLIB_ENABLED if (ctxt->usesGzip == 1) { if (ctxt->strm == NULL) return(0); @@ -1424,7 +1424,7 @@ retry: /* 1 for '?' */ blen += strlen(ctxt->query) + 1; blen += strlen(method) + strlen(ctxt->path) + 24; -#ifdef HAVE_ZLIB_H +#ifdef LIBXML_ZLIB_ENABLED /* reserve for possible 'Accept-Encoding: gzip' string */ blen += 23; #endif @@ -1468,7 +1468,7 @@ retry: ctxt->hostname, ctxt->port); } -#ifdef HAVE_ZLIB_H +#ifdef LIBXML_ZLIB_ENABLED p += snprintf(p, blen - (p - bp), "Accept-Encoding: gzip\r\n"); #endif |