Subject: [Boost-bugs] [Boost C++ Libraries] #5174: Patch to make code_converter flushable
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-02-10 03:15:18
#5174: Patch to make code_converter flushable
--------------------------------------------------------+-------------------
Reporter: eddie@⦠| Owner: turkanis
Type: Patches | Status: new
Milestone: To Be Determined | Component: iostreams
Version: Boost 1.45.0 | Severity: Problem
Keywords: code_converter flush sync buffer iostreams |
--------------------------------------------------------+-------------------
I've attached a little patch that makes iostreams::code_converter
flushable. It seems like it really should be. Is there any chance
someone could look at this? I've included some test code as well that
outputs the following.
The reason I need this functionality is because I am converting the
[http://savannah.nongnu.org/projects/fastcgipp fastcgi++] library
over to use boost iostreams for filtering capabilities. Unfortunately
if the code_converter can not flush it is useless.
********** OUTPUT BEFORE PATCH **********
main(): Sending 24 characters of data to output stream
SinkDev::write(): Recieved 16 characters.
main(): Calling a sync on the output stream
main(): Sending 21 characters of data to output stream
SinkDev::write(): Recieved 16 characters.
main(): Asking for 24 characters of data from input stream
SourceDev::read(): Sending 16 characters.
SourceDev::read(): Sending 16 characters.
main(): Calling a sync on the input stream
main(): Asking for 9 characters of data from input stream
SourceDev::read(): Sending 16 characters.
main(): At end of test case
SinkDev::write(): Recieved 13 characters.
********** OUTPUT AFTER PATCH **********
main(): Sending 24 characters of data to output stream
SinkDev::write(): Recieved 16 characters.
main(): Calling a sync on the output stream
SinkDev::write(): Recieved 8 characters.
main(): Sending 21 characters of data to output stream
SinkDev::write(): Recieved 16 characters.
main(): Asking for 24 characters of data from input stream
SourceDev::read(): Sending 16 characters.
SourceDev::read(): Sending 16 characters.
main(): Calling a sync on the input stream
main(): Asking for 9 characters of data from input stream
SourceDev::read(): Sending 16 characters.
main(): At end of test case
SinkDev::write(): Recieved 5 characters.
SinkDev::write(): Recieved 0 characters.
SinkDev::write(): Recieved 0 characters.
SinkDev::write(): Recieved 0 characters.
********** END **********
Notice that input functionality doesn't change but the output
functionality does. The one cause for concern to me is that for some
reason upon deconstruction the new flush() function is called a bunch of
extras times. I'm not entirely sure why this is happening.
--
Eddie Carle
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5174> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:05 UTC