Loading lib/README.encoding +3 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,9 @@ Currently, libcurl only understands how to process responses that use the that will work (besides "identity," which does nothing) are "deflate" and "gzip" If a response is encoded using the "compress" or methods, libcurl will return an error indicating that the response could not be decoded. If <string> is NULL or empty no Accept-Encoding header is generated. <string> is NULL no Accept-Encoding header is generated. If <string> is a zero-length string, then an Accept-Encoding header containing all supported encodings will be generated. The CURLOPT_ENCODING must be set to any non-NULL value for content to be automatically decoded. If it is not set and the server still sends encoded Loading lib/content_encoding.h +10 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,16 @@ * * $Id$ ***************************************************************************/ #include "setup.h" /* * Comma-separated list all supported Content-Encodings ('identity' is implied) */ #ifdef HAVE_LIBZ #define ALL_CONTENT_ENCODINGS "deflate, gzip" #else #define ALL_CONTENT_ENCODINGS "identity" #endif CURLcode Curl_unencode_deflate_write(struct SessionHandle *data, struct Curl_transfer_keeper *k, Loading lib/transfer.c +3 −1 Original line number Diff line number Diff line Loading @@ -893,7 +893,9 @@ CURLcode Curl_readwrite(struct connectdata *conn, if(k->badheader < HEADER_ALLBAD) { /* This switch handles various content encodings. If there's an error here, be sure to check over the almost identical code in http_chunks.c. 08/29/02 jhrg */ in http_chunks.c. 08/29/02 jhrg Make sure that ALL_CONTENT_ENCODINGS contains all the encodings handled here. */ #ifdef HAVE_LIBZ switch (k->content_encoding) { case IDENTITY: Loading lib/url.c +9 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,7 @@ #include "escape.h" #include "strtok.h" #include "share.h" #include "content_encoding.h" /* And now for the protocols */ #include "ftp.h" Loading Loading @@ -825,8 +826,16 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...) case CURLOPT_ENCODING: /* * String to use at the value of Accept-Encoding header. 08/28/02 jhrg * * If the encoding is set to "" we use an Accept-Encoding header that * encompasses all the encodings we support. * If the encoding is set to NULL we don't send an Accept-Encoding header * and ignore an received Content-Encoding header. * */ data->set.encoding = va_arg(param, char *); if(data->set.encoding && !*data->set.encoding) data->set.encoding = (char*)ALL_CONTENT_ENCODINGS; break; case CURLOPT_USERPWD: Loading Loading
lib/README.encoding +3 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,9 @@ Currently, libcurl only understands how to process responses that use the that will work (besides "identity," which does nothing) are "deflate" and "gzip" If a response is encoded using the "compress" or methods, libcurl will return an error indicating that the response could not be decoded. If <string> is NULL or empty no Accept-Encoding header is generated. <string> is NULL no Accept-Encoding header is generated. If <string> is a zero-length string, then an Accept-Encoding header containing all supported encodings will be generated. The CURLOPT_ENCODING must be set to any non-NULL value for content to be automatically decoded. If it is not set and the server still sends encoded Loading
lib/content_encoding.h +10 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,16 @@ * * $Id$ ***************************************************************************/ #include "setup.h" /* * Comma-separated list all supported Content-Encodings ('identity' is implied) */ #ifdef HAVE_LIBZ #define ALL_CONTENT_ENCODINGS "deflate, gzip" #else #define ALL_CONTENT_ENCODINGS "identity" #endif CURLcode Curl_unencode_deflate_write(struct SessionHandle *data, struct Curl_transfer_keeper *k, Loading
lib/transfer.c +3 −1 Original line number Diff line number Diff line Loading @@ -893,7 +893,9 @@ CURLcode Curl_readwrite(struct connectdata *conn, if(k->badheader < HEADER_ALLBAD) { /* This switch handles various content encodings. If there's an error here, be sure to check over the almost identical code in http_chunks.c. 08/29/02 jhrg */ in http_chunks.c. 08/29/02 jhrg Make sure that ALL_CONTENT_ENCODINGS contains all the encodings handled here. */ #ifdef HAVE_LIBZ switch (k->content_encoding) { case IDENTITY: Loading
lib/url.c +9 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,7 @@ #include "escape.h" #include "strtok.h" #include "share.h" #include "content_encoding.h" /* And now for the protocols */ #include "ftp.h" Loading Loading @@ -825,8 +826,16 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...) case CURLOPT_ENCODING: /* * String to use at the value of Accept-Encoding header. 08/28/02 jhrg * * If the encoding is set to "" we use an Accept-Encoding header that * encompasses all the encodings we support. * If the encoding is set to NULL we don't send an Accept-Encoding header * and ignore an received Content-Encoding header. * */ data->set.encoding = va_arg(param, char *); if(data->set.encoding && !*data->set.encoding) data->set.encoding = (char*)ALL_CONTENT_ENCODINGS; break; case CURLOPT_USERPWD: Loading