mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
ConnProperties: atomic "authenticated" field
This commit is contained in:
parent
bb9cf83744
commit
d8b37328a1
@ -18,12 +18,17 @@ with this program. If not, see <https://www.gnu.org/licenses/>
|
||||
|
||||
#include "ConnectionProperties.h"
|
||||
|
||||
ConnectionProperties::ConnectionProperties()
|
||||
: _authenticated(false)
|
||||
{
|
||||
}
|
||||
|
||||
bool ConnectionProperties::isAuthenticated()
|
||||
{
|
||||
return _authenticated;
|
||||
return _authenticated.load();
|
||||
}
|
||||
|
||||
void ConnectionProperties::setAuthenticated(bool authenticated)
|
||||
{
|
||||
_authenticated = authenticated;
|
||||
_authenticated.store(authenticated);
|
||||
}
|
@ -18,11 +18,14 @@ with this program. If not, see <https://www.gnu.org/licenses/>
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <boost/atomic.hpp>
|
||||
|
||||
class ConnectionProperties
|
||||
{
|
||||
public:
|
||||
explicit ConnectionProperties();
|
||||
bool isAuthenticated();
|
||||
void setAuthenticated(bool authenticated);
|
||||
private:
|
||||
bool _authenticated;
|
||||
boost::atomic<bool> _authenticated;
|
||||
};
|
@ -155,7 +155,6 @@ void WSServer::onOpen(connection_hdl hdl)
|
||||
{
|
||||
QMutexLocker locker(&_clMutex);
|
||||
_connections.insert(hdl);
|
||||
_connectionProperties[hdl] = ConnectionProperties();
|
||||
locker.unlock();
|
||||
|
||||
QString clientIp = getRemoteEndpoint(hdl);
|
||||
|
Loading…
x
Reference in New Issue
Block a user