Move the call to cancel_timer to the right place

This commit is contained in:
Vinnie Falco
2014-11-23 13:45:15 -08:00
committed by Nik Bougalis
parent f9aa3e0da5
commit 62d400c3a9

View File

@@ -83,7 +83,7 @@ detect_peer_protocol (Socket& socket, StreamBuf& buf, Yield yield)
The type for 'hello' is 1.
*/
if (n>=1 && data[0] != 0)
break;;
break;
if (n>=2 && data[1] != 0)
break;
if (n>=5 && data[4] != 0)
@@ -188,12 +188,12 @@ SSLPeer::do_close()
stream_.async_shutdown (strand_.wrap (std::bind (
&SSLPeer::on_shutdown, shared_from_this(),
std::placeholders::_1)));
cancel_timer();
}
void
SSLPeer::on_shutdown (error_code ec)
{
cancel_timer();
stream_.lowest_layer().close(ec);
}