From fea2ae0866cafffa08584945efbadbec17fa6233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Mon, 20 Dec 2021 15:00:35 +0100 Subject: [PATCH] Add new line for json rpc data sending --- libnymea-core/servers/tunnelproxyserver.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libnymea-core/servers/tunnelproxyserver.cpp b/libnymea-core/servers/tunnelproxyserver.cpp index 8ef784a0..9b1b4c84 100644 --- a/libnymea-core/servers/tunnelproxyserver.cpp +++ b/libnymea-core/servers/tunnelproxyserver.cpp @@ -76,7 +76,8 @@ void TunnelProxyServer::sendData(const QUuid &clientId, const QByteArray &data) return; } - tunnelProxySocket->writeData(data); + // Note: we add a \n at the end of the data for easier json parsing on the other end + tunnelProxySocket->writeData(data + '\n'); } void TunnelProxyServer::sendData(const QList &clients, const QByteArray &data) @@ -108,6 +109,7 @@ bool TunnelProxyServer::startServer() bool TunnelProxyServer::stopServer() { + qCDebug(dcTunnelProxyServer()) << "Stopping server"; m_tunnelProxySocketServer->stopServer(); return true; }