Fix common include and libnymea-remoteproxyclient dev package

This commit is contained in:
Simon Stürz 2021-08-05 16:38:29 +02:00
parent f4b5fba91d
commit 6d4ff26481
10 changed files with 25 additions and 18 deletions

View File

@ -1,6 +1,5 @@
include(../nymea-remoteproxy.pri)
include(../libnymea-remoteproxyclient/libnymea-remoteproxyclient.pri)
include(../common/common.pri)
TARGET = nymea-remoteproxy-client
TEMPLATE = app

View File

@ -30,7 +30,7 @@
#include "loggingcategories.h"
#include "jsonrpc/jsontypes.h"
#include "transportclient.h"
#include "slipdataprocessor.h"
#include "../common/slipdataprocessor.h"
#include <QJsonDocument>
#include <QJsonParseError>

View File

@ -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);

View File

@ -1,7 +1,7 @@
#include "tunnelproxyclient.h"
#include "loggingcategories.h"
#include "server/transportinterface.h"
#include "slipdataprocessor.h"
#include "../common/slipdataprocessor.h"
namespace remoteproxy {

View File

@ -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

View File

@ -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);
}

View File

@ -28,17 +28,19 @@
#ifndef TUNNELPROXYREMOTECONNECTION_H
#define TUNNELPROXYREMOTECONNECTION_H
#include <QUrl>
#include <QUuid>
#include <QObject>
#include <QSslError>
#include <QAbstractSocket>
#include <QLoggingCategory>
#include "proxyconnection.h"
Q_DECLARE_LOGGING_CATEGORY(dcTunnelProxyRemoteConnection)
namespace remoteproxyclient {
class JsonRpcClient;
class ProxyConnection;
class TunnelProxyRemoteConnection : public QObject
{

View File

@ -28,11 +28,12 @@
#ifndef TUNNELPROXYSOCKETSERVER_H
#define TUNNELPROXYSOCKETSERVER_H
#include <QUrl>
#include <QUuid>
#include <QObject>
#include <QSslError>
#include <QLoggingCategory>
#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
{

View File

@ -682,6 +682,7 @@ void RemoteProxyTestsTunnelProxy::testTunnelProxyClient()
TunnelProxySocketServer *tunnelProxyServer = new TunnelProxySocketServer(serverUuid, serverName, this);
connect(tunnelProxyServer, &TunnelProxySocketServer::sslErrors, this, [=](const QList<QSslError> &errors){
qDebug() << errors;
tunnelProxyServer->ignoreSslErrors(errors);
});

View File

@ -28,7 +28,7 @@ ServerConnection::ServerConnection(const QUrl &serverUrl, const QString &name, c
connect(m_socketServer, &TunnelProxySocketServer::sslErrors, this, [=](const QList<QSslError> &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) {