Retry the network packet if it failed to unserialize

This happens if the network packet is big enough to not transfer in one
go.
This commit is contained in:
Matthijs Tijink 2019-03-09 16:22:03 +01:00
parent bcb985adda
commit 97705c3c76

View file

@ -352,6 +352,7 @@ void LanLinkProvider::newConnection()
void LanLinkProvider::dataReceived()
{
QSslSocket* socket = qobject_cast<QSslSocket*>(sender());
socket->startTransaction();
const QByteArray data = socket->readLine();
@ -362,8 +363,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();