Fix messages pile up (#921)

Fix #924
This commit is contained in:
cyan317
2023-10-11 17:24:39 +01:00
committed by GitHub
parent 8d783ecd6a
commit 7080b4d549

View File

@@ -63,7 +63,7 @@ protected:
if (!ec_ && ec != boost::asio::error::operation_aborted)
{
ec_ = ec;
LOG(perfLog_.info()) << tag() << ": " << what << ": " << ec.message();
LOG(perfLog_.error()) << tag() << ": " << what << ": " << ec.message();
boost::beast::get_lowest_layer(derived().ws()).socket().close(ec);
(*handler_)(ec, derived().shared_from_this());
}
@@ -106,14 +106,14 @@ public:
void
onWrite(boost::system::error_code ec, std::size_t)
{
messages_.pop();
sending_ = false;
if (ec)
{
wsFail(ec, "Failed to write");
}
else
{
messages_.pop();
sending_ = false;
maybeSendNext();
}
}