boost.asio - change buffer size in HTTP Client example

Hi!
There's example HTTP Client at http://www.boost.org/doc/libs/1_39_0/doc/html/boost_asio/example/http/client/async_client.cpp
Please help me to change maximum buffer size like explained in following code (it's from examples downloaded with library, not from site):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  void handle_write_request(const boost::system::error_code& err)
  {
    if (!err)
    {
      // Read the response status line. The response_ streambuf will
      // automatically grow to accommodate the entire line. The growth may be
      // limited by passing a maximum size to the streambuf constructor.
      boost::asio::async_read_until(socket_, response_, "\r\n",
          boost::bind(&client::handle_read_status_line, this,
            boost::asio::placeholders::error));
    }
    else
    {
      std::cout << "Error: " << err.message() << "\n";
    }
  }

And here's the constructor of response buffer:
 
boost::asio::streambuf response_;

But compiler says that following code is invalid:
 
boost::asio::streambuf response_(1024);

It seems that default buffer is 512 bytes sized, I need larger size.
Last edited on
Topic archived. No new replies allowed.