From a2c6f0a8064f4426129018daa15cb82c6d33b69c Mon Sep 17 00:00:00 2001 From: Matthijs Tijink Date: Sat, 9 Mar 2019 16:22:03 +0100 Subject: [PATCH] Retry the network packet if it failed to unserialize This happens if the network packet is big enough to not transfer in one go. --- core/backends/lan/lanlinkprovider.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/backends/lan/lanlinkprovider.cpp b/core/backends/lan/lanlinkprovider.cpp index a6dda376b..77a50d3d2 100644 --- a/core/backends/lan/lanlinkprovider.cpp +++ b/core/backends/lan/lanlinkprovider.cpp @@ -350,6 +350,7 @@ void LanLinkProvider::newConnection() void LanLinkProvider::dataReceived() { QSslSocket* socket = qobject_cast(sender()); + socket->startTransaction(); const QByteArray data = socket->readLine(); @@ -360,8 +361,10 @@ void LanLinkProvider::dataReceived() if (!success) { delete np; + socket->rollbackTransaction(); return; } + socket->commitTransaction(); if (np->type() != PACKET_TYPE_IDENTITY) { qCWarning(KDECONNECT_CORE) << "LanLinkProvider/newConnection: Expected identity, received " << np->type();