mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-11 08:06:41 +02:00
fix crash during heavy websocket load
This commit is contained in:
parent
5d7bac11ba
commit
e9dbb6c3b6
5 changed files with 103 additions and 49 deletions
|
@ -20,6 +20,7 @@
|
|||
#define CONTROL_SESSION_TCP_HPP
|
||||
|
||||
#include "control_session.hpp"
|
||||
#include <deque>
|
||||
|
||||
/// Endpoint for a connected control client.
|
||||
/**
|
||||
|
@ -31,7 +32,7 @@ class ControlSessionTcp : public ControlSession, public std::enable_shared_from_
|
|||
{
|
||||
public:
|
||||
/// ctor. Received message from the client are passed to MessageReceiver
|
||||
ControlSessionTcp(ControlMessageReceiver* receiver, tcp::socket&& socket);
|
||||
ControlSessionTcp(ControlMessageReceiver* receiver, boost::asio::io_context& ioc, tcp::socket&& socket);
|
||||
~ControlSessionTcp() override;
|
||||
void start() override;
|
||||
void stop() override;
|
||||
|
@ -44,8 +45,12 @@ public:
|
|||
|
||||
protected:
|
||||
void do_read();
|
||||
void send_next();
|
||||
|
||||
tcp::socket socket_;
|
||||
boost::asio::streambuf streambuf_;
|
||||
boost::asio::io_context::strand strand_;
|
||||
std::deque<std::string> messages_;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue