Fix API Subscription initialisation (#1354)

* Fix #1352,#1351

* Fix/Add details on client address
This commit is contained in:
LordGrey
2021-10-16 13:55:23 +02:00
committed by GitHub
parent 532ac7e330
commit c9a7258160
6 changed files with 20 additions and 5 deletions

View File

@@ -102,7 +102,7 @@ void JsonServer::newConnection()
{
if(_netOrigin->accessAllowed(socket->peerAddress(), socket->localAddress()))
{
Debug(_log, "New connection from: %s ",socket->localAddress().toString().toStdString().c_str());
Debug(_log, "New connection from: %s",QSTRING_CSTR(socket->peerAddress().toString()));
JsonClientConnection * connection = new JsonClientConnection(socket, _netOrigin->isLocalAddress(socket->peerAddress(), socket->localAddress()));
_openConnections.insert(connection);
@@ -118,7 +118,7 @@ void JsonServer::newConnection()
void JsonServer::closedConnection()
{
JsonClientConnection* connection = qobject_cast<JsonClientConnection*>(sender());
Debug(_log, "Connection closed");
Debug(_log, "Connection closed for %s", QSTRING_CSTR(connection->getClientAddress().toString()));
_openConnections.remove(connection);
// schedule to delete the connection object