title: boost read_until does not stop at delimiter
body: <p>I'm using the boost read_until function to facilitate receiving and parsing HTTP messages over a socket. So what I'm <em>trying</em> to do is read_until from the socket until <code>\r\n</code>, which I think should give me one line of the HTTP header. (Each HTTP header line ends in <code>\r\n</code>, per the standard.) However, what I'm actually getting from read_line instead is the entire header, several lines long. (The header ends in <code>\r\n\r\n</code>, or in other words, a blank line. Also, per the HTTP standard.)  Here's a code snippet. <code>sock</code> is the socket file descriptor.</p>
  
  <pre><code>boost::system::error_code err;
  io::streambuf request_buff;
  
  io::read_until(sock, request_buff, "\r\n", err); // read request line
  if (err)
    throw Exception(string("Failed to read HTTP header request line from socket: ") + err.message());
  cerr &lt;&lt; "Read " &lt;&lt; request_buff.size() &lt;&lt; " bytes." &lt;&lt; endl;
  
  istream request(&amp;request_buff);
  try {
    request &gt;&gt; m_strMethod &gt;&gt; m_strPath &gt;&gt; m_strHttpVersion;
  
  } catch (std::exception&amp; e) {
    throw Exception(string("Failed to parse HTTP header: ") + e.what(), e);
  }
  
  if (!request)
    throw Exception("Failed to read HTTP header");
  if (!alg::istarts_with(m_strHttpVersion, "HTTP/"))
    throw Exception(string("Malformed HTTP header: expected HTTP version but got: ") + m_strHttpVersion);
  
  string strTemp;
  while (std::getline(request, strTemp))
  {
    cerr &lt;&lt; "Extra line size = " &lt;&lt; strTemp.size() &lt;&lt; endl;
    cerr &lt;&lt; "Extra line: '" &lt;&lt; strTemp &lt;&lt; '\'' &lt;&lt; endl;
  }
  </code></pre>
  
  <p>What I expect to see is output indicating it read the number of bytes in the first line of the HTTP message and no "Extra" output. What I get instead is the number of bytes in the entire HTTP header, and a blank extra line (which maybe is because the >> operations didn't consume the newline at the end of the first line) followed by every other line in the header, and another blank line (which indicates the end of the header, as noted above). Why is read_until reading more from the socket than the first line of the header and putting it into request_buff?</p>
  
  <p>Note, I used netcat to receive the request and it's coming through okay. So the HTTP message itself appears to be correctly formatted.</p>