diff --git a/libnymea-remoteproxy/loggingcategories.cpp b/libnymea-remoteproxy/loggingcategories.cpp index b4aaae6..1122fa6 100644 --- a/libnymea-remoteproxy/loggingcategories.cpp +++ b/libnymea-remoteproxy/loggingcategories.cpp @@ -30,6 +30,7 @@ Q_LOGGING_CATEGORY(dcApplication, "Application") Q_LOGGING_CATEGORY(dcEngine, "Engine") Q_LOGGING_CATEGORY(dcJsonRpc, "JsonRpc") +Q_LOGGING_CATEGORY(dcTunnel, "Tunnel") Q_LOGGING_CATEGORY(dcJsonRpcTraffic, "JsonRpcTraffic") Q_LOGGING_CATEGORY(dcWebSocketServer, "WebSocketServer") Q_LOGGING_CATEGORY(dcWebSocketServerTraffic, "WebSocketServerTraffic") diff --git a/libnymea-remoteproxy/loggingcategories.h b/libnymea-remoteproxy/loggingcategories.h index 0d79c02..329be4c 100644 --- a/libnymea-remoteproxy/loggingcategories.h +++ b/libnymea-remoteproxy/loggingcategories.h @@ -34,6 +34,7 @@ Q_DECLARE_LOGGING_CATEGORY(dcApplication) Q_DECLARE_LOGGING_CATEGORY(dcEngine) Q_DECLARE_LOGGING_CATEGORY(dcJsonRpc) +Q_DECLARE_LOGGING_CATEGORY(dcTunnel) Q_DECLARE_LOGGING_CATEGORY(dcJsonRpcTraffic) Q_DECLARE_LOGGING_CATEGORY(dcWebSocketServer) Q_DECLARE_LOGGING_CATEGORY(dcWebSocketServerTraffic) diff --git a/libnymea-remoteproxy/proxyserver.cpp b/libnymea-remoteproxy/proxyserver.cpp index 8c451d5..d4c61d1 100644 --- a/libnymea-remoteproxy/proxyserver.cpp +++ b/libnymea-remoteproxy/proxyserver.cpp @@ -185,6 +185,8 @@ void ProxyServer::establishTunnel(ProxyClient *firstClient, ProxyClient *secondC secondClient->setTunnelConnected(true); qCDebug(dcProxyServer()) << tunnel; + qCDebug(dcTunnel()) << "Tunnel established between" << firstClient->peerAddress().toString() << firstClient->uuid() + << "<-->" << secondClient->peerAddress().toString() << secondClient->uuid(); m_totalTunnelCount += 1; saveStatistics(); @@ -242,12 +244,13 @@ void ProxyServer::onClientDisconnected(const QUuid &clientId) // Check if if (m_tunnels.contains(proxyClient->tunnelIdentifier())) { - // There is a tunnel connection for this client, remove the tunnel and disconnect also the other client ProxyClient *remoteClient = getRemoteClient(proxyClient); TunnelConnection tunnelConnection = m_tunnels.take(proxyClient->tunnelIdentifier()); Engine::instance()->logEngine()->logTunnel(tunnelConnection); if (remoteClient) { + qCDebug(dcTunnel()) << "Remove tunnel between" << proxyClient->peerAddress().toString() << proxyClient->uuid() + << "<-->" << remoteClient->peerAddress().toString() << remoteClient->uuid(); remoteClient->killConnection("Tunnel client disconnected"); } } diff --git a/nymea-remoteproxy-logging.conf b/nymea-remoteproxy-logging.conf index 71477ef..9dbac85 100644 --- a/nymea-remoteproxy-logging.conf +++ b/nymea-remoteproxy-logging.conf @@ -2,6 +2,7 @@ *.debug=false Application.debug=true Engine.debug=true +Tunnel.debug=true JsonRpc.debug=true JsonRpcTraffic.debug=false WebSocketServer.debug=true