Fix warning in is_ssl_handshake

This commit is contained in:
Vinnie Falco
2018-11-22 18:31:57 -08:00
parent 2585625459
commit e0b3aa7745
2 changed files with 6 additions and 5 deletions

View File

@@ -8,6 +8,7 @@ Version 191:
* Use mp11 in detail::variant
* Fix buffers_cat uninitialized warning
* Fix static_string uninitialized warning
* Fix warning in is_ssl_handshake
--------------------------------------------------------------------------------

View File

@@ -67,14 +67,14 @@ is_ssl_handshake(
boost::asio::is_const_buffer_sequence<ConstBufferSequence>::value,
"ConstBufferSequence requirements not met");
// We need at least one byte to really do anything
if(boost::asio::buffer_size(buffers) < 1)
return boost::indeterminate;
// Extract the first byte, which holds the
// "message" type for the Handshake protocol.
unsigned char v;
boost::asio::buffer_copy(boost::asio::buffer(&v, 1), buffers);
if(boost::asio::buffer_copy(boost::asio::buffer(&v, 1), buffers) < 1)
{
// We need at least one byte to really do anything
return boost::indeterminate;
}
// Check that the message type is "SSL Handshake" (rfc2246)
if(v != 0x16)