Opened 12 years ago

Last modified 12 years ago

#5133 new Bugs

Iostreams code_converter buffer

Reported by: eddie@… Owned by: Jonathan Turkanis
Milestone: To Be Determined Component: iostreams
Version: Boost 1.45.0 Severity: Problem
Keywords: code_converter flush sync buffer iostreams Cc:

Description

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.

Change History (1)

comment:1 by anonymous, 12 years ago

Keywords: sync iostreams added; 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 size of the 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 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 from the stream and go directly in myDevice as per stream.push(myDevice 8192) the 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)) 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 looking for such a constructor when I specify a size for the code converter? Thirdly I can not for the life of me make the code converter it's data. If I call a stream.strict_sync() should the not get flushed as well? It doesn't. Everything else in the chain does but the won't fully until destruction. removed
Note: See TracTickets for help on using tickets.