mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-22 13:36:18 +02:00
Don't send client update as Client.Set response
This commit is contained in:
parent
86f766721d
commit
506f179ed2
3 changed files with 7 additions and 4 deletions
|
@ -44,7 +44,7 @@ ControlServer::~ControlServer()
|
|||
}
|
||||
|
||||
|
||||
void ControlServer::send(const std::string& message)
|
||||
void ControlServer::send(const std::string& message, const ControlSession* excludeSession)
|
||||
{
|
||||
std::unique_lock<std::mutex> mlock(mutex_);
|
||||
for (auto it = sessions_.begin(); it != sessions_.end(); )
|
||||
|
@ -63,8 +63,11 @@ void ControlServer::send(const std::string& message)
|
|||
}
|
||||
|
||||
for (auto s : sessions_)
|
||||
{
|
||||
if (s.get() != excludeSession)
|
||||
s->sendAsync(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ControlServer::onMessageReceived(ControlSession* connection, const std::string& message)
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
void stop();
|
||||
|
||||
/// Send a message to all connceted clients
|
||||
void send(const std::string& message);
|
||||
void send(const std::string& message, const ControlSession* excludeSession = NULL);
|
||||
|
||||
/// Clients call this when they receive a message. Implementation of MessageReceiver::onMessageReceived
|
||||
virtual void onMessageReceived(ControlSession* connection, const std::string& message);
|
||||
|
|
|
@ -196,7 +196,7 @@ void StreamServer::onMessageReceived(ControlSession* controlSession, const std::
|
|||
|
||||
Config::instance().save();
|
||||
json notification = JsonNotification::getJson("Client.OnUpdate", clientInfo->toJson());
|
||||
controlServer_->send(notification.dump());
|
||||
controlServer_->send(notification.dump(), controlSession);
|
||||
}
|
||||
|
||||
controlSession->send(request.getResponse(response).dump());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue