fix crash during heavy websocket load

This commit is contained in:
badaix 2019-11-15 17:45:49 +01:00
parent 5d7bac11ba
commit e9dbb6c3b6
5 changed files with 103 additions and 49 deletions

View file

@ -117,7 +117,7 @@ void ControlServer::handleAccept(tcp::socket socket, Args&&... args)
setsockopt(socket.native_handle(), SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
// socket->set_option(boost::asio::ip::tcp::no_delay(false));
SLOG(NOTICE) << "ControlServer::NewConnection: " << socket.remote_endpoint().address().to_string() << endl;
shared_ptr<SessionType> session = make_shared<SessionType>(this, std::move(socket), std::forward<Args>(args)...);
shared_ptr<SessionType> session = make_shared<SessionType>(this, io_context_, std::move(socket), std::forward<Args>(args)...);
{
std::lock_guard<std::recursive_mutex> mlock(session_mutex_);
session->start();