mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-12 16:46:42 +02:00
init player when receiving a header message
This commit is contained in:
parent
94944681c2
commit
7b1323646f
12 changed files with 149 additions and 117 deletions
|
@ -113,9 +113,12 @@ void ControlSession::reader()
|
|||
while (active_)
|
||||
{
|
||||
asio::streambuf response;
|
||||
asio::read_until(*socket_, response, "\r\n");
|
||||
asio::read_until(*socket_, response, "\n");
|
||||
std::string s((istreambuf_iterator<char>(&response)), istreambuf_iterator<char>());
|
||||
s.resize(s.length() - 2);
|
||||
size_t len = s.length() - 1;
|
||||
if ((len >= 2) && s[len-2] == '\r')
|
||||
--len;
|
||||
s.resize(len);
|
||||
|
||||
if (messageReceiver_ != NULL)
|
||||
messageReceiver_->onMessageReceived(this, s);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue