handle serious errors in on_accept_connection handler

This commit is contained in:
arvidn 2017-12-27 14:14:58 +01:00 committed by Arvid Norberg
parent 1884061418
commit 5ebd05b047
1 changed files with 3 additions and 3 deletions

View File

@ -2531,9 +2531,9 @@ namespace {
TORRENT_ASSERT((ssl == transport::ssl) == is_ssl(*c));
#endif
listener->async_accept(*str
, std::bind(&session_impl::on_accept_connection, this, c
, std::weak_ptr<tcp::acceptor>(listener), _1, ssl));
std::weak_ptr<tcp::acceptor> ls(listener);
listener->async_accept(*str, [this, c, ls, ssl] (error_code const& ec)
{ return this->wrap(&session_impl::on_accept_connection, c, ls, ec, ssl); });
}
void session_impl::on_accept_connection(std::shared_ptr<socket_type> const& s