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:
parent
bcb985adda
commit
97705c3c76
1 changed files with 3 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue