diff --git a/client/client.pro b/client/client.pro index cbc09dd..4af05f0 100644 --- a/client/client.pro +++ b/client/client.pro @@ -1,6 +1,5 @@ include(../nymea-remoteproxy.pri) include(../libnymea-remoteproxyclient/libnymea-remoteproxyclient.pri) -include(../common/common.pri) TARGET = nymea-remoteproxy-client TEMPLATE = app diff --git a/libnymea-remoteproxy/server/jsonrpcserver.cpp b/libnymea-remoteproxy/server/jsonrpcserver.cpp index 9fcb61a..4b3085e 100644 --- a/libnymea-remoteproxy/server/jsonrpcserver.cpp +++ b/libnymea-remoteproxy/server/jsonrpcserver.cpp @@ -30,7 +30,7 @@ #include "loggingcategories.h" #include "jsonrpc/jsontypes.h" #include "transportclient.h" -#include "slipdataprocessor.h" +#include "../common/slipdataprocessor.h" #include #include diff --git a/libnymea-remoteproxy/server/tcpsocketserver.cpp b/libnymea-remoteproxy/server/tcpsocketserver.cpp index a0dcf3d..f2d1079 100644 --- a/libnymea-remoteproxy/server/tcpsocketserver.cpp +++ b/libnymea-remoteproxy/server/tcpsocketserver.cpp @@ -97,9 +97,10 @@ void TcpSocketServer::onClientDisconnected(QSslSocket *client) { QUuid clientId = m_clientList.key(client); qCDebug(dcTcpSocketServer()) << "Client disconnected:" << client << client->peerAddress().toString() << clientId.toString(); - m_clientList.take(clientId); - // Note: the SslServer is deleting the socket object - emit clientDisconnected(clientId); + if (m_clientList.take(clientId)) { + // Note: the SslServer is deleting the socket object + emit clientDisconnected(clientId); + } } bool TcpSocketServer::startServer() @@ -175,7 +176,7 @@ void SslServer::incomingConnection(qintptr socketDescriptor) if (m_sslEnabled) { qCDebug(dcTcpSocketServer()) << "Start SSL encryption for" << sslSocket; sslSocket->setSslConfiguration(m_config); - addPendingConnection(sslSocket); + //addPendingConnection(sslSocket); sslSocket->startServerEncryption(); } else { emit clientConnected(sslSocket); diff --git a/libnymea-remoteproxy/tunnelproxy/tunnelproxyclient.cpp b/libnymea-remoteproxy/tunnelproxy/tunnelproxyclient.cpp index 600177f..19dffcb 100644 --- a/libnymea-remoteproxy/tunnelproxy/tunnelproxyclient.cpp +++ b/libnymea-remoteproxy/tunnelproxy/tunnelproxyclient.cpp @@ -1,7 +1,7 @@ #include "tunnelproxyclient.h" #include "loggingcategories.h" #include "server/transportinterface.h" -#include "slipdataprocessor.h" +#include "../common/slipdataprocessor.h" namespace remoteproxy { diff --git a/libnymea-remoteproxyclient/libnymea-remoteproxyclient.pro b/libnymea-remoteproxyclient/libnymea-remoteproxyclient.pro index a6410a3..008d64c 100644 --- a/libnymea-remoteproxyclient/libnymea-remoteproxyclient.pro +++ b/libnymea-remoteproxyclient/libnymea-remoteproxyclient.pro @@ -6,14 +6,16 @@ target.path = $$[QT_INSTALL_LIBS] include(libnymea-remoteproxyclient.pri) -installheaders.files = \ - remoteproxyconnection.h \ - tunnelproxy/tunnelproxyremoteconnection.h \ - tunnelproxy/tunnelproxysocket.h \ - tcpsocketconnection.h +installheaders.files = remoteproxyconnection.h installheaders.path = $$[QT_INSTALL_PREFIX]/include/nymea-remoteproxyclient/ -INSTALLS += target installheaders +installtunnelheaders.files = tunnelproxy/tunnelproxyremoteconnection.h \ + tunnelproxy/tunnelproxysocket.h \ + tunnelproxy/tunnelproxysocketserver.h +installtunnelheaders.path = $$[QT_INSTALL_PREFIX]/include/nymea-remoteproxyclient/tunnelproxy + + +INSTALLS += target installheaders installtunnelheaders # Create pkgconfig file CONFIG += create_pc create_prl no_install_prl diff --git a/libnymea-remoteproxyclient/tcpsocketconnection.cpp b/libnymea-remoteproxyclient/tcpsocketconnection.cpp index 2ecd55a..cca948d 100644 --- a/libnymea-remoteproxyclient/tcpsocketconnection.cpp +++ b/libnymea-remoteproxyclient/tcpsocketconnection.cpp @@ -80,7 +80,7 @@ void TcpSocketConnection::onEncrypted() void TcpSocketConnection::onError(QAbstractSocket::SocketError error) { - qCDebug(dcRemoteProxyClientTcpSocket()) << "Socket error occured" << error << m_tcpSocket->errorString(); + qCWarning(dcRemoteProxyClientTcpSocket()) << "Socket error occured" << error << m_tcpSocket->errorString(); emit errorOccured(error); } diff --git a/libnymea-remoteproxyclient/tunnelproxy/tunnelproxyremoteconnection.h b/libnymea-remoteproxyclient/tunnelproxy/tunnelproxyremoteconnection.h index 36ce220..20bb60f 100644 --- a/libnymea-remoteproxyclient/tunnelproxy/tunnelproxyremoteconnection.h +++ b/libnymea-remoteproxyclient/tunnelproxy/tunnelproxyremoteconnection.h @@ -28,17 +28,19 @@ #ifndef TUNNELPROXYREMOTECONNECTION_H #define TUNNELPROXYREMOTECONNECTION_H +#include #include #include +#include +#include #include -#include "proxyconnection.h" - Q_DECLARE_LOGGING_CATEGORY(dcTunnelProxyRemoteConnection) namespace remoteproxyclient { class JsonRpcClient; +class ProxyConnection; class TunnelProxyRemoteConnection : public QObject { diff --git a/libnymea-remoteproxyclient/tunnelproxy/tunnelproxysocketserver.h b/libnymea-remoteproxyclient/tunnelproxy/tunnelproxysocketserver.h index e193bd3..8d9d16f 100644 --- a/libnymea-remoteproxyclient/tunnelproxy/tunnelproxysocketserver.h +++ b/libnymea-remoteproxyclient/tunnelproxy/tunnelproxysocketserver.h @@ -28,11 +28,12 @@ #ifndef TUNNELPROXYSOCKETSERVER_H #define TUNNELPROXYSOCKETSERVER_H +#include #include #include +#include #include -#include "proxyconnection.h" #include "tunnelproxysocket.h" Q_DECLARE_LOGGING_CATEGORY(dcTunnelProxySocketServer) @@ -41,6 +42,7 @@ Q_DECLARE_LOGGING_CATEGORY(dcTunnelProxySocketServerTraffic) namespace remoteproxyclient { class JsonRpcClient; +class ProxyConnection; class TunnelProxySocketServer : public QObject { diff --git a/tests/test-tunnelproxy/remoteproxyteststunnelproxy.cpp b/tests/test-tunnelproxy/remoteproxyteststunnelproxy.cpp index 93618f4..e14655f 100644 --- a/tests/test-tunnelproxy/remoteproxyteststunnelproxy.cpp +++ b/tests/test-tunnelproxy/remoteproxyteststunnelproxy.cpp @@ -682,6 +682,7 @@ void RemoteProxyTestsTunnelProxy::testTunnelProxyClient() TunnelProxySocketServer *tunnelProxyServer = new TunnelProxySocketServer(serverUuid, serverName, this); connect(tunnelProxyServer, &TunnelProxySocketServer::sslErrors, this, [=](const QList &errors){ + qDebug() << errors; tunnelProxyServer->ignoreSslErrors(errors); }); diff --git a/tunnelclient/serverconnection.cpp b/tunnelclient/serverconnection.cpp index 6b2632c..be48d3c 100644 --- a/tunnelclient/serverconnection.cpp +++ b/tunnelclient/serverconnection.cpp @@ -28,7 +28,7 @@ ServerConnection::ServerConnection(const QUrl &serverUrl, const QString &name, c connect(m_socketServer, &TunnelProxySocketServer::sslErrors, this, [=](const QList &errors){ if (m_insecure) { qDebug() << "SSL errors occured. Ignoring because explicit specified."; - m_socketServer->ignoreSslErrors(); + m_socketServer->ignoreSslErrors(errors); } else { qWarning() << "SSL errors occured:"; foreach (const QSslError &sslError, errors) {