Boost logo

Boost Users :

Subject: [Boost-users] Iostreams code_converter peculiarities
From: Eddie Carle (eddie_at_[hidden])
Date: 2011-01-24 21:23:35


I've been working on converting a the fastcgi++ library over to using
boost::iostreams from std::iostreams and I've noticed some peculiarities
that I can't seem to work passed.

For one, how do you change the buffer size of the code_converter adaptor?
The built in facilities don't seem to actually do anything. I am adding
to a filtering_stream and have noticed that for the following
statements...

stream.push(code_converter<MyDevice>(myDevice), 8192);
stream.push(code_converter<MyDevice>(myDevice, 8192));
stream.push(code_converter<MyDevice>(myDevice, 8192), 8192);

All result in a buffer of 128 bytes. I can't figure out a way to actually
change it. I've been monitoring what is going in the myDevice and it is
always 128 byte chunks (or less). If I remove the code_converter from the
stream and go directly in myDevice as per

stream.push(myDevice, 8192);

the buffer is sized as I want it to be and myDevice receives chunks of
data maxing at 8192 bytes.

Secondly, when using the statement

stream.push(code_converter<MyDevice>(myDevice, 8192));

code_converter calls not MyDevice(const MyDevice&) for copying
constructing the object but for some reason MyDevice(const MyDevice&,
const long int&). What is that? Why is code_converter looking for such a
constructor when I specify a buffer size for the code converter?

Thirdly, I can not for the life of me make the code converter flush it's
data. If I call a stream.strict_sync() should the code_converter not get
flushed as well? It doesn't. Everything else in the chain does but the
code_converter won't fully flush until destruction.

Thanks.

-- 
	Eddie Carle

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net