From 23462e194e0b8f94130438898c6ddb0163144cb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Mon, 16 Aug 2021 07:41:54 +0200 Subject: [PATCH] Add tunnel proxy statistics and fix typo --- client/proxyclient.cpp | 10 +++--- client/proxyclient.h | 2 +- libnymea-remoteproxy/engine.cpp | 1 + .../jsonrpc/authenticationhandler.cpp | 2 +- libnymea-remoteproxy/loggingcategories.cpp | 2 +- libnymea-remoteproxy/proxy/proxyclient.cpp | 2 +- libnymea-remoteproxy/proxy/proxyclient.h | 2 +- libnymea-remoteproxy/proxy/proxyserver.cpp | 6 ++-- libnymea-remoteproxy/proxy/proxyserver.h | 3 +- .../server/tcpsocketserver.cpp | 2 +- .../tunnelproxy/tunnelproxyserver.cpp | 33 +++++++++++++++++++ .../tunnelproxy/tunnelproxyserver.h | 2 ++ libnymea-remoteproxyclient/proxyconnection.h | 2 +- .../remoteproxyconnection.cpp | 6 ++-- .../remoteproxyconnection.h | 2 +- .../tcpsocketconnection.cpp | 4 +-- .../tunnelproxyremoteconnection.cpp | 6 ++-- .../tunnelproxy/tunnelproxyremoteconnection.h | 2 +- .../tunnelproxy/tunnelproxysocketserver.cpp | 10 +++--- .../tunnelproxy/tunnelproxysocketserver.h | 4 +-- .../websocketconnection.cpp | 4 +-- monitor/monitorclient.cpp | 6 ++-- monitor/monitorclient.h | 2 +- tests/test-proxy/remoteproxytestsproxy.cpp | 4 +-- tunnelclient/clientconnection.cpp | 6 ++-- tunnelclient/serverconnection.cpp | 2 +- 26 files changed, 81 insertions(+), 46 deletions(-) diff --git a/client/proxyclient.cpp b/client/proxyclient.cpp index aff255a..ec5564c 100644 --- a/client/proxyclient.cpp +++ b/client/proxyclient.cpp @@ -42,7 +42,7 @@ ProxyClient::ProxyClient(const QString &name, const QUuid &uuid, RemoteProxyConn connect(m_connection, &RemoteProxyConnection::authenticated, this, &ProxyClient::onAuthenticationFinished); connect(m_connection, &RemoteProxyConnection::remoteConnectionEstablished, this, &ProxyClient::onRemoteConnectionEstablished); connect(m_connection, &RemoteProxyConnection::dataReady, this, &ProxyClient::onDataReady); - connect(m_connection, &RemoteProxyConnection::errorOccured, this, &ProxyClient::onErrorOccured); + connect(m_connection, &RemoteProxyConnection::errorOccurred, this, &ProxyClient::onErrorOccurred); connect(m_connection, &RemoteProxyConnection::disconnected, this, &ProxyClient::onClientDisconnected); connect(m_connection, &RemoteProxyConnection::sslErrors, this, &ProxyClient::onSslErrors); } @@ -57,9 +57,9 @@ void ProxyClient::setPingpong(bool enable) m_pingpong = enable; } -void ProxyClient::onErrorOccured(QAbstractSocket::SocketError error) +void ProxyClient::onErrorOccurred(QAbstractSocket::SocketError error) { - qCWarning(dcProxyClient()) << "Error occured" << error; + qCWarning(dcProxyClient()) << "Error occurred" << error; exit(-1); } @@ -100,10 +100,10 @@ void ProxyClient::onClientDisconnected() void ProxyClient::onSslErrors(const QList errors) { if (m_insecure) { - qCDebug(dcProxyClient()) << "SSL errors occured. Ignoring because explicit specified."; + qCDebug(dcProxyClient()) << "SSL errors occurred. Ignoring because explicit specified."; m_connection->ignoreSslErrors(); } else { - qCWarning(dcProxyClient()) << "SSL errors occured:"; + qCWarning(dcProxyClient()) << "SSL errors occurred:"; foreach (const QSslError &sslError, errors) { qCWarning(dcProxyClient()) << " --> " << sslError.errorString(); } diff --git a/client/proxyclient.h b/client/proxyclient.h index 97b5d78..ca2bdad 100644 --- a/client/proxyclient.h +++ b/client/proxyclient.h @@ -57,7 +57,7 @@ private: RemoteProxyConnection *m_connection = nullptr; private slots: - void onErrorOccured(QAbstractSocket::SocketError error); + void onErrorOccurred(QAbstractSocket::SocketError error); void onClientReady(); void onAuthenticationFinished(); void onRemoteConnectionEstablished(); diff --git a/libnymea-remoteproxy/engine.cpp b/libnymea-remoteproxy/engine.cpp index 1169d93..469795c 100644 --- a/libnymea-remoteproxy/engine.cpp +++ b/libnymea-remoteproxy/engine.cpp @@ -256,6 +256,7 @@ QVariantMap Engine::createServerStatistic() monitorData.insert("serverVersion", SERVER_VERSION_STRING); monitorData.insert("apiVersion", API_VERSION_STRING); monitorData.insert("proxyStatistic", proxyServer()->currentStatistics()); + monitorData.insert("tunnelProxyStatistic", tunnelProxyServer()->currentStatistics()); return monitorData; } diff --git a/libnymea-remoteproxy/jsonrpc/authenticationhandler.cpp b/libnymea-remoteproxy/jsonrpc/authenticationhandler.cpp index 1682446..b3a049d 100644 --- a/libnymea-remoteproxy/jsonrpc/authenticationhandler.cpp +++ b/libnymea-remoteproxy/jsonrpc/authenticationhandler.cpp @@ -95,7 +95,7 @@ void AuthenticationHandler::onAuthenticationFinished() JsonReply *jsonReply = m_runningAuthentications.take(authenticationReply); if (authenticationReply->error() != Authenticator::AuthenticationErrorNoError) { - qCWarning(dcJsonRpc()) << "Authentication error occured" << authenticationReply->error(); + qCWarning(dcJsonRpc()) << "Authentication error occurred" << authenticationReply->error(); jsonReply->setSuccess(false); } else { // Successfully authenticated diff --git a/libnymea-remoteproxy/loggingcategories.cpp b/libnymea-remoteproxy/loggingcategories.cpp index d470a3f..4db02c1 100644 --- a/libnymea-remoteproxy/loggingcategories.cpp +++ b/libnymea-remoteproxy/loggingcategories.cpp @@ -39,9 +39,9 @@ Q_LOGGING_CATEGORY(dcWebSocketServerTraffic, "WebSocketServerTraffic") Q_LOGGING_CATEGORY(dcAuthentication, "Authentication") Q_LOGGING_CATEGORY(dcAuthenticationProcess, "AuthenticationProcess") Q_LOGGING_CATEGORY(dcProxyServer, "ProxyServer") +Q_LOGGING_CATEGORY(dcProxyServerTraffic, "ProxyServerTraffic") Q_LOGGING_CATEGORY(dcTunnelProxyServer, "TunnelProxyServer") Q_LOGGING_CATEGORY(dcTunnelProxyServerTraffic, "TunnelProxyServerTraffic") -Q_LOGGING_CATEGORY(dcProxyServerTraffic, "ProxyServerTraffic") Q_LOGGING_CATEGORY(dcMonitorServer, "MonitorServer") Q_LOGGING_CATEGORY(dcAwsCredentialsProvider, "AwsCredentialsProvider") Q_LOGGING_CATEGORY(dcAwsCredentialsProviderTraffic, "AwsCredentialsProviderTraffic") diff --git a/libnymea-remoteproxy/proxy/proxyclient.cpp b/libnymea-remoteproxy/proxy/proxyclient.cpp index 1189dd6..1b5b68b 100644 --- a/libnymea-remoteproxy/proxy/proxyclient.cpp +++ b/libnymea-remoteproxy/proxy/proxyclient.cpp @@ -37,7 +37,7 @@ ProxyClient::ProxyClient(TransportInterface *interface, const QUuid &clientId, c TransportClient(interface, clientId, address, parent) { m_timer = new QTimer(this); - connect(m_timer, &QTimer::timeout, this, &ProxyClient::timeoutOccured); + connect(m_timer, &QTimer::timeout, this, &ProxyClient::timeoutOccurred); m_timer->setSingleShot(true); resetTimer(); } diff --git a/libnymea-remoteproxy/proxy/proxyclient.h b/libnymea-remoteproxy/proxy/proxyclient.h index 529d99e..8d4aff5 100644 --- a/libnymea-remoteproxy/proxy/proxyclient.h +++ b/libnymea-remoteproxy/proxy/proxyclient.h @@ -90,7 +90,7 @@ private: signals: void authenticated(); void tunnelConnected(); - void timeoutOccured(); + void timeoutOccurred(); }; diff --git a/libnymea-remoteproxy/proxy/proxyserver.cpp b/libnymea-remoteproxy/proxy/proxyserver.cpp index e0f1e4e..228687e 100644 --- a/libnymea-remoteproxy/proxy/proxyserver.cpp +++ b/libnymea-remoteproxy/proxy/proxyserver.cpp @@ -216,7 +216,7 @@ void ProxyServer::onClientConnected(const QUuid &clientId, const QHostAddress &a ProxyClient *proxyClient = new ProxyClient(interface, clientId, address, this); connect(proxyClient, &ProxyClient::authenticated, this, &ProxyServer::onProxyClientAuthenticated); - connect(proxyClient, &ProxyClient::timeoutOccured, this, &ProxyServer::onProxyClientTimeoutOccured); + connect(proxyClient, &ProxyClient::timeoutOccurred, this, &ProxyServer::onProxyClientTimeoutOccurred); m_totalClientCount += 1; saveStatistics(); @@ -375,10 +375,10 @@ void ProxyServer::onProxyClientAuthenticated() } } -void ProxyServer::onProxyClientTimeoutOccured() +void ProxyServer::onProxyClientTimeoutOccurred() { ProxyClient *proxyClient = static_cast(sender()); - qCDebug(dcProxyServer()) << "Timeout occured for" << proxyClient; + qCDebug(dcProxyServer()) << "Timeout occurred for" << proxyClient; switch (proxyClient->timerWaitState()) { case ProxyClient::TimerWaitStateInactive: proxyClient->killConnection("Proxy timeout occuret. The socket was inactive."); diff --git a/libnymea-remoteproxy/proxy/proxyserver.h b/libnymea-remoteproxy/proxy/proxyserver.h index edc5ba2..2f8d1fa 100644 --- a/libnymea-remoteproxy/proxy/proxyserver.h +++ b/libnymea-remoteproxy/proxy/proxyserver.h @@ -83,7 +83,6 @@ private: void loadStatistics(); void saveStatistics(); - // Helper methods ProxyClient *getRemoteClient(ProxyClient *proxyClient); void establishTunnel(ProxyClient *firstClient, ProxyClient *secondClient); @@ -97,7 +96,7 @@ private slots: void onClientDataAvailable(const QUuid &clientId, const QByteArray &data); void onProxyClientAuthenticated(); - void onProxyClientTimeoutOccured(); + void onProxyClientTimeoutOccurred(); public slots: void startServer(); diff --git a/libnymea-remoteproxy/server/tcpsocketserver.cpp b/libnymea-remoteproxy/server/tcpsocketserver.cpp index 3e627fd..558232d 100644 --- a/libnymea-remoteproxy/server/tcpsocketserver.cpp +++ b/libnymea-remoteproxy/server/tcpsocketserver.cpp @@ -200,7 +200,7 @@ void SslServer::onSocketReadyRead() void SslServer::onSocketError(QAbstractSocket::SocketError error) { - qCWarning(dcTcpSocketServer()) << "Socket error occured" << error; + qCWarning(dcTcpSocketServer()) << "Socket error occurred" << error; } } diff --git a/libnymea-remoteproxy/tunnelproxy/tunnelproxyserver.cpp b/libnymea-remoteproxy/tunnelproxy/tunnelproxyserver.cpp index d9f8697..32b384b 100644 --- a/libnymea-remoteproxy/tunnelproxy/tunnelproxyserver.cpp +++ b/libnymea-remoteproxy/tunnelproxy/tunnelproxyserver.cpp @@ -197,6 +197,39 @@ TunnelProxyServer::TunnelProxyError TunnelProxyServer::disconnectClient(const QU return TunnelProxyServer::TunnelProxyErrorNoError; } +QVariantMap TunnelProxyServer::currentStatistics() +{ + QVariantMap statisticsMap; + statisticsMap.insert("totalClientCount", m_proxyClients.count()); + statisticsMap.insert("serverConnectionsCount", m_tunnelProxyServerConnections.count()); + statisticsMap.insert("clientConnectionsCount", m_tunnelProxyClientConnections.count()); + + QVariantList tunnelConnections; + foreach (TunnelProxyServerConnection *serverConnection, m_tunnelProxyServerConnections) { + QVariantMap serverMap; + serverMap.insert("id", serverConnection->transportClient()->clientId().toString()); + serverMap.insert("address", serverConnection->transportClient()->peerAddress().toString()); + serverMap.insert("timestamp", serverConnection->transportClient()->creationTime()); + serverMap.insert("name", serverConnection->transportClient()->name()); + serverMap.insert("serverUuid", serverConnection->transportClient()->uuid()); + QVariantList clientList; + foreach (TunnelProxyClientConnection *clientConnection, serverConnection->clientConnections()) { + QVariantMap clientMap; + clientMap.insert("id", clientConnection->transportClient()->clientId().toString()); + clientMap.insert("address", clientConnection->transportClient()->peerAddress().toString()); + clientMap.insert("timestamp", clientConnection->transportClient()->creationTime()); + clientMap.insert("name", clientConnection->transportClient()->name()); + clientMap.insert("clientUuid", clientConnection->transportClient()->uuid()); + clientList.append(clientMap); + } + serverMap.insert("clientConnections", clientList); + } + + statisticsMap.insert("tunnelConnections", tunnelConnections); + + return statisticsMap; +} + void TunnelProxyServer::startServer() { qCDebug(dcTunnelProxyServer()) << "Starting tunnel proxy..."; diff --git a/libnymea-remoteproxy/tunnelproxy/tunnelproxyserver.h b/libnymea-remoteproxy/tunnelproxy/tunnelproxyserver.h index 937b370..987390e 100644 --- a/libnymea-remoteproxy/tunnelproxy/tunnelproxyserver.h +++ b/libnymea-remoteproxy/tunnelproxy/tunnelproxyserver.h @@ -67,6 +67,8 @@ public: TunnelProxyServer::TunnelProxyError registerClient(const QUuid &clientId, const QUuid &clientUuid, const QString &clientName, const QUuid &serverUuid); TunnelProxyServer::TunnelProxyError disconnectClient(const QUuid &clientId, quint16 socketAddress); + QVariantMap currentStatistics(); + public slots: void startServer(); void stopServer(); diff --git a/libnymea-remoteproxyclient/proxyconnection.h b/libnymea-remoteproxyclient/proxyconnection.h index f67ebdc..6cfb7b1 100644 --- a/libnymea-remoteproxyclient/proxyconnection.h +++ b/libnymea-remoteproxyclient/proxyconnection.h @@ -65,7 +65,7 @@ signals: void dataReceived(const QByteArray &data); void stateChanged(QAbstractSocket::SocketState state); - void errorOccured(QAbstractSocket::SocketError error); + void errorOccurred(QAbstractSocket::SocketError error); void sslErrors(const QList &errors); diff --git a/libnymea-remoteproxyclient/remoteproxyconnection.cpp b/libnymea-remoteproxyclient/remoteproxyconnection.cpp index dde5028..44f018e 100644 --- a/libnymea-remoteproxyclient/remoteproxyconnection.cpp +++ b/libnymea-remoteproxyclient/remoteproxyconnection.cpp @@ -192,8 +192,8 @@ void RemoteProxyConnection::setError(QAbstractSocket::SocketError error) return; m_error = error; - qCDebug(dcRemoteProxyClientConnection()) << "Error occured" << m_error; - emit errorOccured(m_error); + qCDebug(dcRemoteProxyClientConnection()) << "Error occurred" << m_error; + emit errorOccurred(m_error); } void RemoteProxyConnection::onConnectionChanged(bool isConnected) @@ -337,7 +337,7 @@ bool RemoteProxyConnection::connectServer(const QUrl &url) connect(m_connection, &ProxyConnection::connectedChanged, this, &RemoteProxyConnection::onConnectionChanged); connect(m_connection, &ProxyConnection::dataReceived, this, &RemoteProxyConnection::onConnectionDataAvailable); - connect(m_connection, &ProxyConnection::errorOccured, this, &RemoteProxyConnection::onConnectionSocketError); + connect(m_connection, &ProxyConnection::errorOccurred, this, &RemoteProxyConnection::onConnectionSocketError); connect(m_connection, &ProxyConnection::stateChanged, this, &RemoteProxyConnection::onConnectionStateChanged); connect(m_connection, &ProxyConnection::sslErrors, this, &RemoteProxyConnection::sslErrors); diff --git a/libnymea-remoteproxyclient/remoteproxyconnection.h b/libnymea-remoteproxyclient/remoteproxyconnection.h index 1eeeb6d..f0df215 100644 --- a/libnymea-remoteproxyclient/remoteproxyconnection.h +++ b/libnymea-remoteproxyclient/remoteproxyconnection.h @@ -133,7 +133,7 @@ signals: void disconnected(); void stateChanged(RemoteProxyConnection::State state); - void errorOccured(QAbstractSocket::SocketError error); + void errorOccurred(QAbstractSocket::SocketError error); void sslErrors(const QList &errors); void dataReady(const QByteArray &data); diff --git a/libnymea-remoteproxyclient/tcpsocketconnection.cpp b/libnymea-remoteproxyclient/tcpsocketconnection.cpp index 0f69742..180314a 100644 --- a/libnymea-remoteproxyclient/tcpsocketconnection.cpp +++ b/libnymea-remoteproxyclient/tcpsocketconnection.cpp @@ -88,8 +88,8 @@ void TcpSocketConnection::onEncrypted() void TcpSocketConnection::onError(QAbstractSocket::SocketError error) { - qCWarning(dcRemoteProxyClientTcpSocket()) << "Socket error occured" << error << m_tcpSocket->errorString(); - emit errorOccured(error); + qCWarning(dcRemoteProxyClientTcpSocket()) << "Socket error occurred" << error << m_tcpSocket->errorString(); + emit errorOccurred(error); } void TcpSocketConnection::onStateChanged(QAbstractSocket::SocketState state) diff --git a/libnymea-remoteproxyclient/tunnelproxy/tunnelproxyremoteconnection.cpp b/libnymea-remoteproxyclient/tunnelproxy/tunnelproxyremoteconnection.cpp index e3778b6..a18f1e8 100644 --- a/libnymea-remoteproxyclient/tunnelproxy/tunnelproxyremoteconnection.cpp +++ b/libnymea-remoteproxyclient/tunnelproxy/tunnelproxyremoteconnection.cpp @@ -123,7 +123,7 @@ bool TunnelProxyRemoteConnection::connectServer(const QUrl &url, const QUuid &se connect(m_connection, &ProxyConnection::connectedChanged, this, &TunnelProxyRemoteConnection::onConnectionChanged); connect(m_connection, &ProxyConnection::dataReceived, this, &TunnelProxyRemoteConnection::onConnectionDataAvailable); - connect(m_connection, &ProxyConnection::errorOccured, this, &TunnelProxyRemoteConnection::onConnectionSocketError); + connect(m_connection, &ProxyConnection::errorOccurred, this, &TunnelProxyRemoteConnection::onConnectionSocketError); connect(m_connection, &ProxyConnection::stateChanged, this, &TunnelProxyRemoteConnection::onConnectionStateChanged); connect(m_connection, &ProxyConnection::sslErrors, this, &TunnelProxyRemoteConnection::sslErrors); @@ -287,8 +287,8 @@ void TunnelProxyRemoteConnection::setError(QAbstractSocket::SocketError error) return; m_error = error; - qCWarning(dcTunnelProxyRemoteConnection()) << "Error occured" << m_error; - emit errorOccured(m_error); + qCWarning(dcTunnelProxyRemoteConnection()) << "Error occurred" << m_error; + emit errorOccurred(m_error); } void TunnelProxyRemoteConnection::cleanUp() diff --git a/libnymea-remoteproxyclient/tunnelproxy/tunnelproxyremoteconnection.h b/libnymea-remoteproxyclient/tunnelproxy/tunnelproxyremoteconnection.h index 20bb60f..1e0e349 100644 --- a/libnymea-remoteproxyclient/tunnelproxy/tunnelproxyremoteconnection.h +++ b/libnymea-remoteproxyclient/tunnelproxy/tunnelproxyremoteconnection.h @@ -90,7 +90,7 @@ public slots: signals: void stateChanged(TunnelProxyRemoteConnection::State state); - void errorOccured(QAbstractSocket::SocketError error); + void errorOccurred(QAbstractSocket::SocketError error); void sslErrors(const QList &errors); void remoteConnectedChanged(bool remoteConnected); diff --git a/libnymea-remoteproxyclient/tunnelproxy/tunnelproxysocketserver.cpp b/libnymea-remoteproxyclient/tunnelproxy/tunnelproxysocketserver.cpp index d7c1e8b..8c1e267 100644 --- a/libnymea-remoteproxyclient/tunnelproxy/tunnelproxysocketserver.cpp +++ b/libnymea-remoteproxyclient/tunnelproxy/tunnelproxysocketserver.cpp @@ -139,7 +139,7 @@ bool TunnelProxySocketServer::startServer(const QUrl &serverUrl) connect(m_connection, &ProxyConnection::connectedChanged, this, &TunnelProxySocketServer::onConnectionChanged); connect(m_connection, &ProxyConnection::dataReceived, this, &TunnelProxySocketServer::onConnectionDataAvailable); - connect(m_connection, &ProxyConnection::errorOccured, this, &TunnelProxySocketServer::onConnectionSocketError); + connect(m_connection, &ProxyConnection::errorOccurred, this, &TunnelProxySocketServer::onConnectionSocketError); connect(m_connection, &ProxyConnection::stateChanged, this, &TunnelProxySocketServer::onConnectionStateChanged); connect(m_connection, &ProxyConnection::sslErrors, this, &TunnelProxySocketServer::sslErrors); @@ -398,8 +398,8 @@ void TunnelProxySocketServer::setError(QAbstractSocket::SocketError error) return; m_error = error; - qCDebug(dcTunnelProxySocketServer()) << "Error occured" << m_error; - emit errorOccured(m_error); + qCDebug(dcTunnelProxySocketServer()) << "Error occurred" << m_error; + emit errorOccurred(m_error); } void TunnelProxySocketServer::setServerError(Error error) @@ -407,9 +407,9 @@ void TunnelProxySocketServer::setServerError(Error error) if (m_serverError == error) return; - qCDebug(dcTunnelProxySocketServer()) << "Server error occured" << error; + qCDebug(dcTunnelProxySocketServer()) << "Server error occurred" << error; m_serverError = error; - emit serverErrorOccured(m_serverError); + emit serverErrorOccurred(m_serverError); } void TunnelProxySocketServer::cleanUp() diff --git a/libnymea-remoteproxyclient/tunnelproxy/tunnelproxysocketserver.h b/libnymea-remoteproxyclient/tunnelproxy/tunnelproxysocketserver.h index 8b9897b..b6925d0 100644 --- a/libnymea-remoteproxyclient/tunnelproxy/tunnelproxysocketserver.h +++ b/libnymea-remoteproxyclient/tunnelproxy/tunnelproxysocketserver.h @@ -106,8 +106,8 @@ public slots: signals: void stateChanged(TunnelProxySocketServer::State state); - void errorOccured(QAbstractSocket::SocketError error); - void serverErrorOccured(Error error); + void errorOccurred(QAbstractSocket::SocketError error); + void serverErrorOccurred(Error error); void sslErrors(const QList &errors); void runningChanged(bool running); diff --git a/libnymea-remoteproxyclient/websocketconnection.cpp b/libnymea-remoteproxyclient/websocketconnection.cpp index 0c2cdc3..da33dba 100644 --- a/libnymea-remoteproxyclient/websocketconnection.cpp +++ b/libnymea-remoteproxyclient/websocketconnection.cpp @@ -72,8 +72,8 @@ void WebSocketConnection::onDisconnected() void WebSocketConnection::onError(QAbstractSocket::SocketError error) { - qCDebug(dcRemoteProxyClientWebSocket()) << "Socket error occured" << error << m_webSocket->errorString(); - emit errorOccured(error); + qCDebug(dcRemoteProxyClientWebSocket()) << "Socket error occurred" << error << m_webSocket->errorString(); + emit errorOccurred(error); } void WebSocketConnection::onStateChanged(QAbstractSocket::SocketState state) diff --git a/monitor/monitorclient.cpp b/monitor/monitorclient.cpp index e173d47..aa4c9aa 100644 --- a/monitor/monitorclient.cpp +++ b/monitor/monitorclient.cpp @@ -38,7 +38,7 @@ MonitorClient::MonitorClient(const QString &serverName, QObject *parent) : connect(m_socket, &QLocalSocket::connected, this, &MonitorClient::onConnected); connect(m_socket, &QLocalSocket::disconnected, this, &MonitorClient::onDisconnected); connect(m_socket, &QLocalSocket::readyRead, this, &MonitorClient::onReadyRead); - connect(m_socket, SIGNAL(error(QLocalSocket::LocalSocketError)), this, SLOT(onErrorOccured(QLocalSocket::LocalSocketError))); + connect(m_socket, SIGNAL(error(QLocalSocket::LocalSocketError)), this, SLOT(onErrorOccurred(QLocalSocket::LocalSocketError))); } void MonitorClient::onConnected() @@ -71,10 +71,10 @@ void MonitorClient::onReadyRead() emit dataReady(dataMap); } -void MonitorClient::onErrorOccured(QLocalSocket::LocalSocketError socketError) +void MonitorClient::onErrorOccurred(QLocalSocket::LocalSocketError socketError) { Q_UNUSED(socketError) - qWarning() << "Local socket error occured" << m_socket->errorString(); + qWarning() << "Local socket error occurred" << m_socket->errorString(); } void MonitorClient::connectMonitor() diff --git a/monitor/monitorclient.h b/monitor/monitorclient.h index 38b3951..82e638e 100644 --- a/monitor/monitorclient.h +++ b/monitor/monitorclient.h @@ -52,7 +52,7 @@ private slots: void onConnected(); void onDisconnected(); void onReadyRead(); - void onErrorOccured(QLocalSocket::LocalSocketError socketError); + void onErrorOccurred(QLocalSocket::LocalSocketError socketError); public slots: void connectMonitor(); diff --git a/tests/test-proxy/remoteproxytestsproxy.cpp b/tests/test-proxy/remoteproxytestsproxy.cpp index 2c6f164..7f4f56a 100644 --- a/tests/test-proxy/remoteproxytestsproxy.cpp +++ b/tests/test-proxy/remoteproxytestsproxy.cpp @@ -1086,7 +1086,7 @@ void RemoteProxyTestsProxy::sslConfigurations() // Connect to the server (insecure disabled) RemoteProxyConnection *connector = new RemoteProxyConnection(QUuid::createUuid(), "Test client one", this); - QSignalSpy spyError(connector, &RemoteProxyConnection::errorOccured); + QSignalSpy spyError(connector, &RemoteProxyConnection::errorOccurred); QVERIFY(connector->connectServer(m_serverUrlProxyWebSocket)); spyError.wait(); QVERIFY(spyError.count() == 1); @@ -1213,7 +1213,7 @@ void RemoteProxyTestsProxy::authenticationReplyConnection() connectionReadySpy.wait(); QVERIFY(connectionReadySpy.count() == 1); - QSignalSpy connectionErrorSpy(connection, &RemoteProxyConnection::errorOccured); + QSignalSpy connectionErrorSpy(connection, &RemoteProxyConnection::errorOccurred); connection->authenticate("blub"); connectionErrorSpy.wait(); QVERIFY(connectionErrorSpy.count() == 1); diff --git a/tunnelclient/clientconnection.cpp b/tunnelclient/clientconnection.cpp index 0f61fa2..55f341e 100644 --- a/tunnelclient/clientconnection.cpp +++ b/tunnelclient/clientconnection.cpp @@ -30,15 +30,15 @@ ClientConnection::ClientConnection(const QUrl &serverUrl, const QString &name, c qDebug() << "Data received" << data; }); - connect(m_remoteConnection, &TunnelProxyRemoteConnection::errorOccured, this, [](QAbstractSocket::SocketError error){ - qWarning() << "Socket error occured" << error; + connect(m_remoteConnection, &TunnelProxyRemoteConnection::errorOccurred, this, [](QAbstractSocket::SocketError error){ + qWarning() << "Socket error occurred" << error; }); connect(m_remoteConnection, &TunnelProxyRemoteConnection::sslErrors, this, [=](const QList &errors){ if (m_insecure) { m_remoteConnection->ignoreSslErrors(errors); } else { - qWarning() << "SSL errors occured:"; + qWarning() << "SSL errors occurred:"; foreach (const QSslError &sslError, errors) { qWarning() << " --> " << sslError.errorString(); } diff --git a/tunnelclient/serverconnection.cpp b/tunnelclient/serverconnection.cpp index 8d91ce0..e9a3713 100644 --- a/tunnelclient/serverconnection.cpp +++ b/tunnelclient/serverconnection.cpp @@ -29,7 +29,7 @@ ServerConnection::ServerConnection(const QUrl &serverUrl, const QString &name, c if (m_insecure) { m_socketServer->ignoreSslErrors(errors); } else { - qWarning() << "SSL errors occured:"; + qWarning() << "SSL errors occurred:"; foreach (const QSslError &sslError, errors) { qWarning() << " --> " << sslError.errorString(); }