kopia lustrzana https://gitlab.com/eliggett/wfview
Flush buffers on excessive missing
rodzic
d29c1ddba7
commit
fe7bdf1345
|
@ -1268,14 +1268,6 @@ void udpBase::dataReceived(QByteArray r)
|
|||
int missCounter = 0;
|
||||
for (quint16 f = rxSeqBuf.lastKey() + 1; f < in->seq; f++)
|
||||
{
|
||||
if (missCounter > 50) {
|
||||
// More than 50 packets missing, something horrific has happened!
|
||||
qDebug(logUdp()) << "Too many missing packets, full reset!";
|
||||
rxSeqBuf.clear();
|
||||
rxMissing.clear();
|
||||
missingMutex.unlock();
|
||||
break;
|
||||
}
|
||||
qDebug(logUdp()) << "Detected missing packet" << f;
|
||||
|
||||
if (rxSeqBuf.size() > BUFSIZE)
|
||||
|
@ -1330,6 +1322,16 @@ void udpBase::sendRetransmitRequest()
|
|||
if (rxMissing.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
else if (rxMissing.size() > 100) {
|
||||
qDebug(logUdp()) << "Too many missing packets," << rxMissing.size() << "flushing all buffers";
|
||||
missingMutex.lock();
|
||||
rxBufferMutex.lock();
|
||||
qDebug(logUdp()) << "Too many missing packets, full reset!";
|
||||
rxSeqBuf.clear();
|
||||
rxMissing.clear();
|
||||
missingMutex.unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
QByteArray missingSeqs;
|
||||
|
||||
|
|
|
@ -908,14 +908,6 @@ void udpServer::commonReceived(QList<CLIENT*>* l, CLIENT* current, QByteArray r)
|
|||
|
||||
for (quint16 f = current->rxSeqBuf.lastKey() + 1; f < in->seq; f++)
|
||||
{
|
||||
if (missCounter > 50) {
|
||||
// More than 50 packets missing, something horrific has happened!
|
||||
qDebug(logUdpServer()) << "Too many missing packets, full reset!";
|
||||
current->rxSeqBuf.clear();
|
||||
current->rxMissing.clear();
|
||||
current->missMutex.unlock();
|
||||
break;
|
||||
}
|
||||
|
||||
qInfo(logUdpServer()) << "Detected missing packet" << f;
|
||||
|
||||
|
@ -1696,6 +1688,17 @@ void udpServer::sendRetransmitRequest(CLIENT* c)
|
|||
if (c->rxMissing.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
else if (c->rxMissing.size() > 100) {
|
||||
qDebug(logUdp()) << "Too many missing packets," << c->rxMissing.size() << "flushing all buffers";
|
||||
c->missMutex.lock();
|
||||
c->rxMutex.lock();
|
||||
qDebug(logUdp()) << "Too many missing packets, full reset!";
|
||||
c->rxSeqBuf.clear();
|
||||
c->rxMissing.clear();
|
||||
c->missMutex.unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
QByteArray missingSeqs;
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue