- The first part

- Added CodeDocs config file for customization
- Fixing LGTM alerts
- LGTM bug fixed again
- added token option to hyperion-remote
- fix DBManager::getDB()
- next bugfix
- correct broken signal from SettingManager to Hyperion
- Token list is created after the schema is fetched

Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>
This commit is contained in:
Paulchen-Panther
2019-07-12 16:54:26 +02:00
parent 4fc745e748
commit ea796160af
72 changed files with 2546 additions and 485 deletions

View File

@@ -1,6 +1,9 @@
#include <protoserver/ProtoServer.h>
#include "ProtoClientConnection.h"
// util
#include <utils/NetOrigin.h>
// qt
#include <QJsonObject>
#include <QTcpServer>
@@ -24,6 +27,7 @@ ProtoServer::~ProtoServer()
void ProtoServer::initServer()
{
_netOrigin = NetOrigin::getInstance();
connect(_server, &QTcpServer::newConnection, this, &ProtoServer::newConnection);
// apply config
@@ -58,11 +62,16 @@ void ProtoServer::newConnection()
{
if(QTcpSocket * socket = _server->nextPendingConnection())
{
Debug(_log, "New connection from %s", QSTRING_CSTR(socket->peerAddress().toString()));
ProtoClientConnection * client = new ProtoClientConnection(socket, _timeout, this);
// internal
connect(client, &ProtoClientConnection::clientDisconnected, this, &ProtoServer::clientDisconnected);
_openConnections.append(client);
if(_netOrigin->accessAllowed(socket->peerAddress(), socket->localAddress()))
{
Debug(_log, "New connection from %s", QSTRING_CSTR(socket->peerAddress().toString()));
ProtoClientConnection * client = new ProtoClientConnection(socket, _timeout, this);
// internal
connect(client, &ProtoClientConnection::clientDisconnected, this, &ProtoServer::clientDisconnected);
_openConnections.append(client);
}
else
socket->close();
}
}
}