title: boost.asio - set maximum read stream size
body: <p>There's example HTTP Client at <a href="http://www.boost.org/doc/libs/1_39_0/doc/html/boost_asio/example/http/client/async_client.cpp" rel="nofollow">http://www.boost.org/doc/libs/1_39_0/doc/html/boost_asio/example/http/client/async_client.cpp</a>
  Please help me to <b>change maximum buffer size</b> like explained in following code (it's from examples downloaded with library, not from site):</p>
  
  <pre><code>void handle_write_request(const boost::system::error_code&amp; 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 &lt;b&gt;passing a maximum size to the streambuf constructor&lt;/b&gt;.
      boost::asio::async_read_until(socket_, response_, "\r\n",
          boost::bind(&amp;client::handle_read_status_line, this,
            boost::asio::placeholders::error));
    }
    else
    {
      std::cout &lt;&lt; "Error: " &lt;&lt; err.message() &lt;&lt; "\n";
    }
  }
  </code></pre>
  
  <p>And here's the constructor of response buffer:</p>
  
  <pre><code>boost::asio::streambuf response_;
  </code></pre>
  
  <p>But compiler says that following code is invalid:</p>
  
  <p><code>boost::asio::streambuf response_(</code><strong><code>1024</code></strong><code>);</code></p>
  
  <p>It seems that default buffer is <code>512</code> bytes sized, I need larger size.</p>