mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-10 07:36:41 +02:00
Pop message from queue before sending it
This commit is contained in:
parent
ae9ecf00e3
commit
c445deb95a
2 changed files with 3 additions and 3 deletions
|
@ -128,10 +128,10 @@ void StreamSession::stop()
|
|||
|
||||
void StreamSession::send_next()
|
||||
{
|
||||
auto buffer = messages_.front();
|
||||
shared_const_buffer buffer = messages_.front();
|
||||
messages_.pop_front();
|
||||
boost::asio::async_write(socket_, buffer,
|
||||
boost::asio::bind_executor(strand_, [ this, self = shared_from_this(), buffer ](boost::system::error_code ec, std::size_t length) {
|
||||
messages_.pop_front();
|
||||
if (ec)
|
||||
{
|
||||
LOG(ERROR, LOG_TAG) << "StreamSession write error (msg length: " << length << "): " << ec.message() << "\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue