Fix websocket keep-alive ping expiration

This commit is contained in:
Vinnie Falco
2019-04-01 18:14:25 -07:00
parent 27c572fbfa
commit 8ec1a4d90f
2 changed files with 7 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
Version 244:
* Tidy up declval in some traits
* Fix websocket keep-alive ping expiration
--------------------------------------------------------------------------------

View File

@@ -424,8 +424,12 @@ struct stream<NextLayer, deflateSupported>::impl_type
if(timeout_opt.idle_timeout != none())
{
idle_counter = 0;
timer.expires_after(
timeout_opt.idle_timeout);
if(timeout_opt.keep_alive_pings)
timer.expires_after(
timeout_opt.idle_timeout / 2);
else
timer.expires_after(
timeout_opt.idle_timeout);
timer.async_wait(
timeout_handler<Executor>(
ex, this->weak_from_this()));