Add tunnel debug category for cleaner log reading
parent
5175052ab3
commit
5ccb84d173
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
*.debug=false
|
||||
Application.debug=true
|
||||
Engine.debug=true
|
||||
Tunnel.debug=true
|
||||
JsonRpc.debug=true
|
||||
JsonRpcTraffic.debug=false
|
||||
WebSocketServer.debug=true
|
||||
|
|
|
|||
Loading…
Reference in New Issue