mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 00:12:57 +00:00
[LIBXML2] Update to version 2.9.8. CORE-15280
This commit is contained in:
parent
61fed54064
commit
5bb277a54b
37 changed files with 545 additions and 493 deletions
16
sdk/lib/3rdparty/libxml2/nanohttp.c
vendored
16
sdk/lib/3rdparty/libxml2/nanohttp.c
vendored
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue