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
6a44902425
commit
a2c6f0a806
1 changed files with 3 additions and 0 deletions
|
@ -350,6 +350,7 @@ void LanLinkProvider::newConnection()
|
|||
void LanLinkProvider::dataReceived()
|
||||
{
|
||||
QSslSocket* socket = qobject_cast<QSslSocket*>(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();
|
||||
|
|
Loading…
Reference in a new issue