Try/catch the DNS decoding

This commit is contained in:
Anton Thomasson 2020-01-04 20:22:13 +01:00
parent ac8b772060
commit 5d337b2d29

View file

@ -136,6 +136,9 @@ void IppDiscovery::readPendingDatagrams()
sender = QHostAddress(sender.toIPv4Address()); sender = QHostAddress(sender.toIPv4Address());
quint16 transactionid, flags, questions, answerRRs, authRRs, addRRs; quint16 transactionid, flags, questions, answerRRs, authRRs, addRRs;
try {
resp >> transactionid >> flags >> questions >> answerRRs >> authRRs >> addRRs; resp >> transactionid >> flags >> questions >> answerRRs >> authRRs >> addRRs;
for(quint16 i = 0; i < questions; i++) for(quint16 i = 0; i < questions; i++)
@ -198,7 +201,12 @@ void IppDiscovery::readPendingDatagrams()
Q_ASSERT(resp.pos() == pos_before+len); Q_ASSERT(resp.pos() == pos_before+len);
} }
}
catch(std::exception e)
{
qDebug() << e.what();
return;
}
qDebug() << "new ipp ptrs" << ipp_ptrs; qDebug() << "new ipp ptrs" << ipp_ptrs;
qDebug() << "ipp ptrs" << _ipp; qDebug() << "ipp ptrs" << _ipp;
qDebug() << "rps" << _rps; qDebug() << "rps" << _rps;