From 7b5f29f4fe122d5bcd3106efdafe9d9c21f1e855 Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Thu, 5 May 2022 01:49:21 +0100 Subject: [PATCH] More retransmit debugging --- udphandler.cpp | 9 +++++++-- udpserver.cpp | 6 +++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/udphandler.cpp b/udphandler.cpp index 81812e8..fc7ecbf 100644 --- a/udphandler.cpp +++ b/udphandler.cpp @@ -1421,7 +1421,8 @@ void udpBase::sendRetransmitRequest() missingMutex.lock(); for (auto it = rxMissing.begin(); it != rxMissing.end(); ++it) { - if (it.key() != NULL) { + if (it.key() != 0x0) + { if (it.value() < 4) { missingSeqs.append(it.key() & 0xff); @@ -1429,11 +1430,15 @@ void udpBase::sendRetransmitRequest() missingSeqs.append(it.key() & 0xff); missingSeqs.append(it.key() >> 8 & 0xff); it.value()++; + it++; } else { qInfo(logUdp()) << this->metaObject()->className() << ": No response for missing packet" << it.key() << "deleting"; it = rxMissing.erase(it); - } + } + } else { + qInfo(logUdp()) << this->metaObject()->className() << ": found empty key in missing buffer"; + it++; } } missingMutex.unlock(); diff --git a/udpserver.cpp b/udpserver.cpp index 2da30db..3a178af 100644 --- a/udpserver.cpp +++ b/udpserver.cpp @@ -1715,7 +1715,7 @@ void udpServer::sendRetransmitRequest(CLIENT* c) { for (auto it = c->rxMissing.begin(); it != c->rxMissing.end(); ++it) { - if (it.key() != NULL) + if (it.key() != 0x00) { if (it.value() < 4) { @@ -1724,6 +1724,7 @@ void udpServer::sendRetransmitRequest(CLIENT* c) missingSeqs.append(it.key() & 0xff); missingSeqs.append(it.key() >> 8 & 0xff); it.value()++; + it++; } else { @@ -1731,6 +1732,9 @@ void udpServer::sendRetransmitRequest(CLIENT* c) qInfo(logUdp()) << this->metaObject()->className() << ": No response for missing packet" << it.key() << "deleting"; it = c->rxMissing.erase(it); } + } else { + qInfo(logUdp()) << this->metaObject()->className() << ": found empty key in missing buffer"; + it++; } }