Documentation work

This commit is contained in:
Vinnie Falco
2017-06-12 05:01:24 -07:00
parent a49c096042
commit 7bde07a850
16 changed files with 180 additions and 177 deletions

View File

@@ -147,12 +147,18 @@ detect_ssl(
// The algorithm should never need more than 4 bytes
BOOST_ASSERT(buffer.size() < 4);
// We need more bytes, but no more than four total.
buffer.commit(stream.read_some(buffer.prepare(4 - buffer.size()), ec));
// Create up to 4 bytes of space in the buffer's output area.
auto const mutable_buffer = buffer.prepare(4 - buffer.size());
// Try to fill our buffer by reading from the stream
std::size_t const bytes_transferred = stream.read_some(mutable_buffer, ec);
// Check for an error
if(ec)
break;
// Commit what we read into the buffer's input area.
buffer.commit(bytes_transferred);
}
// error