title: Can you set a byte-limit for Asio's read_until?
body: <p>I am using <code>boost::asio::read_until</code> to read from a socket until <code>"&lt;EOF&gt;"</code> is received. However, someone could send billions and billions of bytes until the system runs out of RAM and has to shut down. </p>
  
  <p>To avoid that, I want to set a limit to <code>read_until</code>. Like "read until <code>"&lt;EOF&gt;"</code> or until 10MB are reached".</p>
  
  <p>Is there an easy solution to that using <code>read_until</code>, or do I have to switch to <code>read</code> and manually end the reading when <code>"&lt;EOF&gt;"</code> is received?</p>