Skip to content

Commit

Permalink
Wrap additional async_wait falls in strands to prevent crash (see bug…
Browse files Browse the repository at this point in the history
… report Corvusoft#125)
  • Loading branch information
clrusby committed May 3, 2019
1 parent e6f1fc0 commit 8d4af5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/corvusoft/restbed/detail/socket_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ namespace restbed
{
m_timer->cancel( );
m_timer->expires_from_now( m_timeout );
m_timer->async_wait( bind( &SocketImpl::connection_timeout_handler, this, shared_from_this( ), _1 ) );
m_timer->async_wait( m_strand->wrap( bind( &SocketImpl::connection_timeout_handler, this, shared_from_this( ), _1 ) ) );

size_t size = 0;
auto finished = std::make_shared<bool>(false);
Expand Down Expand Up @@ -461,7 +461,7 @@ namespace restbed
{
m_timer->cancel( );
m_timer->expires_from_now( m_timeout );
m_timer->async_wait( bind( &SocketImpl::connection_timeout_handler, this, shared_from_this( ), _1 ) );
m_timer->async_wait( m_strand->wrap( bind( &SocketImpl::connection_timeout_handler, this, shared_from_this( ), _1 ) ) );

#ifdef BUILD_SSL

Expand Down

0 comments on commit 8d4af5b

Please sign in to comment.