fix(eventsub): close connection after timeout (#6059)
This commit is contained in:
@@ -174,13 +174,13 @@ void BM_ParseAndHandleMessages(benchmark::State &state)
|
||||
boost::asio::io_context ioc;
|
||||
boost::asio::ssl::context ssl(
|
||||
boost::asio::ssl::context::method::tls_client);
|
||||
Session sess(ioc, ssl, std::move(listener));
|
||||
auto sess = std::make_shared<Session>(ioc, ssl, std::move(listener));
|
||||
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (const auto &msg : messages)
|
||||
{
|
||||
boost::system::error_code ec = sess.handleMessage(msg);
|
||||
boost::system::error_code ec = sess->handleMessage(msg);
|
||||
assert(!ec);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -556,6 +556,7 @@ void Session::checkKeepalive()
|
||||
{
|
||||
this->listener->onClose(std::move(this->listener), {});
|
||||
}
|
||||
this->close();
|
||||
return;
|
||||
}
|
||||
this->receivedMessage = false;
|
||||
|
||||
@@ -157,8 +157,8 @@ TEST_P(TestHandleMessageP, Run)
|
||||
boost::asio::io_context ioc;
|
||||
boost::asio::ssl::context ssl(
|
||||
boost::asio::ssl::context::method::tls_client);
|
||||
Session sess(ioc, ssl, std::move(listener));
|
||||
auto ec = sess.handleMessage(buf);
|
||||
auto sess = std::make_shared<Session>(ioc, ssl, std::move(listener));
|
||||
auto ec = sess->handleMessage(buf);
|
||||
ASSERT_FALSE(ec.failed())
|
||||
<< ec.what() << ec.message() << ec.location().to_string();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user