diff --git a/include/boost/beast/websocket/impl/stream_impl.hpp b/include/boost/beast/websocket/impl/stream_impl.hpp index 615b4beb19..1ee3809aa4 100644 --- a/include/boost/beast/websocket/impl/stream_impl.hpp +++ b/include/boost/beast/websocket/impl/stream_impl.hpp @@ -439,12 +439,8 @@ struct stream::impl_type if(timeout_opt.idle_timeout != none()) { idle_counter = 0; - if(timeout_opt.keep_alive_pings) - timer.expires_after( - timeout_opt.idle_timeout / 2); - else - timer.expires_after( - timeout_opt.idle_timeout); + timer.expires_after( + timeout_opt.idle_timeout / 2); BOOST_ASIO_HANDLER_LOCATION(( __FILE__, __LINE__, @@ -569,9 +565,9 @@ struct stream::impl_type if(impl.timeout_opt.idle_timeout == none()) return; - if( impl.timeout_opt.keep_alive_pings && - impl.idle_counter < 1) + if( impl.idle_counter < 1 ) { + if( impl.timeout_opt.keep_alive_pings ) { BOOST_ASIO_HANDLER_LOCATION(( __FILE__, __LINE__,