Opened 14 years ago

Closed 12 years ago

Last modified 12 years ago

#2411 closed Bugs (fixed)

bzip2_compressor does not work with filtering_istream

Reported by: rbock@… Owned by: Jonathan Turkanis
Milestone: Boost 1.37.0 Component: iostreams
Version: Boost 1.36.0 Severity: Showstopper
Keywords: filtering_istream, filtering_istreambuf, filtering_ostream, bzip2 Cc:

Description

Hi,

the filtering_istream has a severe problem when used with bzip2_compressor. This might be related to Ticket #2318.

The compressed data is withheld, leaving readers of the filtering_istream with 0 bytes.

When a filtering_ostream is used instead, compression works as expected.

I am going to attach two files, one showing the code which does not work for me at all (using filtering_istream), the other which works as expected (using filtering_ostream).

My platform is Ubuntu 8.04 64bit, gcc 4.2.3, using boost version 1.36, and bzip2 1.0.4.

Thanks for your efforts,

Roland

Attachments (2)

istream_bzip2_failure.cpp (718 bytes ) - added by rbock@… 14 years ago.
This example demonstrates filtering_istream not releasing any bzip2-compressed data (at least on my machine, the reported length of the compressed string is 0)
istream_bzip2_success.cpp (1.6 KB ) - added by rbock@… 14 years ago.
Using filtering_ostream instead of filtering_istream, it works as expected.

Download all attachments as: .zip

Change History (4)

by rbock@…, 14 years ago

Attachment: istream_bzip2_failure.cpp added

This example demonstrates filtering_istream not releasing any bzip2-compressed data (at least on my machine, the reported length of the compressed string is 0)

by rbock@…, 14 years ago

Attachment: istream_bzip2_success.cpp added

Using filtering_ostream instead of filtering_istream, it works as expected.

comment:1 by Steven Watanabe, 12 years ago

Resolution: fixed
Status: newclosed

(In [62957]) Avoid calling BZ2_bzcompress after it has said that it's done. Fixes #2411. ([62952] is also necessary to make the test case from the ticket work.)

comment:2 by rbock@…, 12 years ago

Thanks for fixing these tickets!

Note: See TracTickets for help on using tickets.