1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

bzip2: added the configure option --enable-bzip2-encoding

Use it with the patched bzlib. The patch in contrib.
Added the bzip2-pipe.patch.README.
This commit is contained in:
Witold Filipczyk 2006-12-17 13:11:56 +01:00 committed by Kalle Olavi Niemitalo
parent cc28da68a7
commit 0fe90d6ac6
3 changed files with 12 additions and 4 deletions

View File

@ -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])

View File

@ -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

View File

@ -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;