[backends/lan] Don't fail silently when a UDP packet could not be unserialized

This commit is contained in:
Nicolas Fella 2019-05-04 18:34:59 +02:00
parent 137d504b58
commit eef04f124b

View file

@ -185,7 +185,14 @@ void LanLinkProvider::udpBroadcastReceived()
//qCDebug(KDECONNECT_CORE) << "Datagram " << datagram.data() ;
if (!success || receivedPacket->type() != PACKET_TYPE_IDENTITY) {
if (!success) {
qCDebug(KDECONNECT_CORE) << "Could not unserialize UDP packet";
delete receivedPacket;
continue;
}
if (receivedPacket->type() != PACKET_TYPE_IDENTITY) {
qCDebug(KDECONNECT_CORE) << "Received a UDP packet of wrong type" << receivedPacket->type();
delete receivedPacket;
continue;
}