diff --git a/configure.in b/configure.in index 0426c414..181bf6cc 100644 --- a/configure.in +++ b/configure.in @@ -471,6 +471,10 @@ EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_GZIP, zlib, zlib.h, z, gzdopen, EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_BZIP2, bzlib, bzlib.h, bz2, BZ2_bzReadOpen, [ --without-bzlib disable bzlib support]) +EL_ARG_DEPEND(CONFIG_BZIP2_ENCODING, bzip2_encoding, [CONFIG_BZIP2:yes], + [Bzip2 content encoding], + [ --enable-bzip2-encoding enable Content-Encoding: bzip2 support (requires patched bzlib)]) + EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_IDN, idn, idna.h, idn, stringprep_check_version, [ --without-idn disable international domain names support]) diff --git a/contrib/bzip2-pipe.patch.README b/contrib/bzip2-pipe.patch.README new file mode 100644 index 00000000..3c895913 --- /dev/null +++ b/contrib/bzip2-pipe.patch.README @@ -0,0 +1,4 @@ +With the bzip2-pipe.patch Content-Encoding: bzip2 works with ELinks. +The patched bzlib wasn't heavilly tested in other situations. +bzerror may be set to other error code rather than BZ_IO_ERROR +in some cases, but IMHO it is safe to use this patch. --witekfl diff --git a/src/protocol/http/http.c b/src/protocol/http/http.c index 2d008997..b42bac45 100644 --- a/src/protocol/http/http.c +++ b/src/protocol/http/http.c @@ -720,16 +720,16 @@ http_send_header(struct socket *socket) add_crlf_to_string(&header); /* TODO: Make this encoding.c function. */ -#if defined(CONFIG_GZIP) || defined(CONFIG_BZIP2) +#if defined(CONFIG_GZIP) || defined(CONFIG_BZIP2_ENCODING) add_to_string(&header, "Accept-Encoding: "); -#ifdef CONFIG_BZIP2 +#ifdef CONFIG_BZIP2_ENCODING add_to_string(&header, "bzip2"); #endif #ifdef CONFIG_GZIP -#ifdef CONFIG_BZIP2 +#ifdef CONFIG_BZIP2_ENCODING add_to_string(&header, ", "); #endif @@ -1798,7 +1798,7 @@ again: conn->content_encoding = ENCODING_GZIP; #endif -#ifdef CONFIG_BZIP2 +#ifdef CONFIG_BZIP2_ENCODING if (file_encoding != ENCODING_BZIP2 && (!strcasecmp(d, "bzip2") || !strcasecmp(d, "x-bzip2"))) conn->content_encoding = ENCODING_BZIP2;