mirror of
https://github.com/rkd77/elinks.git
synced 2024-10-29 08:17:18 -04: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:
parent
b5a9ac08e7
commit
0ca94c10c1
@ -474,6 +474,10 @@ EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_GZIP, zlib, zlib.h, z, gzdopen,
|
|||||||
EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_BZIP2, bzlib, bzlib.h, bz2, BZ2_bzReadOpen,
|
EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_BZIP2, bzlib, bzlib.h, bz2, BZ2_bzReadOpen,
|
||||||
[ --without-bzlib disable bzlib support])
|
[ --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,
|
EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_IDN, idn, idna.h, idn, stringprep_check_version,
|
||||||
[ --without-idn disable international domain names support])
|
[ --without-idn disable international domain names support])
|
||||||
|
|
||||||
|
4
contrib/bzip2-pipe.patch.README
Normal file
4
contrib/bzip2-pipe.patch.README
Normal 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
|
@ -719,16 +719,16 @@ http_send_header(struct socket *socket)
|
|||||||
add_crlf_to_string(&header);
|
add_crlf_to_string(&header);
|
||||||
|
|
||||||
/* TODO: Make this encoding.c function. */
|
/* 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: ");
|
add_to_string(&header, "Accept-Encoding: ");
|
||||||
|
|
||||||
#ifdef CONFIG_BZIP2
|
#ifdef CONFIG_BZIP2_ENCODING
|
||||||
add_to_string(&header, "bzip2");
|
add_to_string(&header, "bzip2");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_GZIP
|
#ifdef CONFIG_GZIP
|
||||||
|
|
||||||
#ifdef CONFIG_BZIP2
|
#ifdef CONFIG_BZIP2_ENCODING
|
||||||
add_to_string(&header, ", ");
|
add_to_string(&header, ", ");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1797,7 +1797,7 @@ again:
|
|||||||
conn->content_encoding = ENCODING_GZIP;
|
conn->content_encoding = ENCODING_GZIP;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_BZIP2
|
#ifdef CONFIG_BZIP2_ENCODING
|
||||||
if (file_encoding != ENCODING_BZIP2
|
if (file_encoding != ENCODING_BZIP2
|
||||||
&& (!strcasecmp(d, "bzip2") || !strcasecmp(d, "x-bzip2")))
|
&& (!strcasecmp(d, "bzip2") || !strcasecmp(d, "x-bzip2")))
|
||||||
conn->content_encoding = ENCODING_BZIP2;
|
conn->content_encoding = ENCODING_BZIP2;
|
||||||
|
Loading…
Reference in New Issue
Block a user