mirror of
https://github.com/badaix/snapcast.git
synced 2025-04-30 02:37:15 +02:00
Possible Websocket fix
This commit is contained in:
parent
ee1a8dbc38
commit
ade2bc9bf7
1 changed files with 3 additions and 3 deletions
|
@ -313,8 +313,8 @@ void ControlSessionHttp::sendAsync(const std::string& message)
|
||||||
if (!ws_)
|
if (!ws_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
strand_.post([ this, self = shared_from_this(), message ]() {
|
strand_.post([ this, self = shared_from_this(), msg = message ]() {
|
||||||
messages_.emplace_back(message);
|
messages_.push_back(std::move(msg));
|
||||||
if (messages_.size() > 1)
|
if (messages_.size() > 1)
|
||||||
{
|
{
|
||||||
LOG(DEBUG) << "HTTP session outstanding async_writes: " << messages_.size() << "\n";
|
LOG(DEBUG) << "HTTP session outstanding async_writes: " << messages_.size() << "\n";
|
||||||
|
@ -329,7 +329,7 @@ void ControlSessionHttp::send_next()
|
||||||
if (!ws_)
|
if (!ws_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto message = messages_.front();
|
const std::string& message = messages_.front();
|
||||||
ws_->async_write(boost::asio::buffer(message),
|
ws_->async_write(boost::asio::buffer(message),
|
||||||
boost::asio::bind_executor(strand_, [ this, self = shared_from_this() ](std::error_code ec, std::size_t length) {
|
boost::asio::bind_executor(strand_, [ this, self = shared_from_this() ](std::error_code ec, std::size_t length) {
|
||||||
messages_.pop_front();
|
messages_.pop_front();
|
||||||
|
|
Loading…
Add table
Reference in a new issue