[boost::asio] can't read into short streambuf

Hi boosters! I try to use asio::read_until() with a asio::streambuf of limited size and get the following error for sizes < 512: "boost::asio::streambuf too long" For sizes >= 512 everything works fine. Here is what I do: // create streambuf with max_size < 512 streambuf sbuf(100); // read into it ... read_until( socket, sbuf, expr, error_handler ); // throws here! What's wrong here? Cheers Sascha

Hi Sascha, Sascha Seewald <vudu@gmx.net> wrote:
Yep I'm aware of this problem, but don't have a fix implemented for it yet. When I first implemented the streambuf class I assumed that the max_size value was really just there to prevent memory exhaustion, and would always be very large. However later I realised there are use cases for setting a small max_size. I will try to fix this be soon. For now, don't set it to a small value :) Cheers, Chris
participants (2)
-
Christopher Kohlhoff
-
Sascha Seewald