mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-28 16:36:17 +02:00
add HTTP and websocket support (preliminary)
This commit is contained in:
parent
8920e8c710
commit
6566235831
10 changed files with 329 additions and 169 deletions
|
@ -55,13 +55,18 @@ void ControlSessionTcp::do_read()
|
|||
line.resize(line.size() - 1);
|
||||
LOG(INFO) << "received: " << line << "\n";
|
||||
if ((message_receiver_ != nullptr) && !line.empty())
|
||||
message_receiver_->onMessageReceived(this, line);
|
||||
{
|
||||
string response = message_receiver_->onMessageReceived(this, line);
|
||||
if (!response.empty())
|
||||
sendAsync(response);
|
||||
}
|
||||
}
|
||||
streambuf_.consume(bytes_transferred);
|
||||
do_read();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
void ControlSessionTcp::start()
|
||||
{
|
||||
do_read();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue