kopia lustrzana https://gitlab.com/eliggett/wfview
More fixes to make client and server behave in same way
rodzic
bdca404457
commit
3aefa68939
|
@ -1317,10 +1317,6 @@ void udpBase::dataReceived(QByteArray r)
|
|||
{
|
||||
rxBufferMutex.lock();
|
||||
if (rxSeqBuf.isEmpty()) {
|
||||
if (rxSeqBuf.size() > BUFSIZE)
|
||||
{
|
||||
rxSeqBuf.erase(rxSeqBuf.begin());
|
||||
}
|
||||
rxSeqBuf.insert(in->seq, QTime::currentTime());
|
||||
}
|
||||
else
|
||||
|
|
|
@ -885,9 +885,9 @@ void udpServer::commonReceived(QList<CLIENT*>* l, CLIENT* current, QByteArray r)
|
|||
else
|
||||
{
|
||||
|
||||
if (in->seq < current->rxSeqBuf.firstKey())
|
||||
if (in->seq < current->rxSeqBuf.firstKey() || in->seq - current->rxSeqBuf.lastKey() > MAX_MISSING)
|
||||
{
|
||||
qInfo(logUdpServer()) << current->ipAddress.toString() << "(" << current->type << "): ******* seq number may have rolled over ****** previous highest: " <<
|
||||
qInfo(logUdpServer()) << current->ipAddress.toString() << "(" << current->type << "Large seq number gap detected, previous highest: " <<
|
||||
QString("0x%1").arg(current->rxSeqBuf.lastKey(), 0, 16) << " current: " << QString("0x%1").arg(in->seq, 0, 16);
|
||||
// Looks like it has rolled over so clear buffer and start again.
|
||||
if (current->rxMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
|
||||
|
@ -918,6 +918,8 @@ void udpServer::commonReceived(QList<CLIENT*>* l, CLIENT* current, QByteArray r)
|
|||
// Add incoming packet to the received buffer and if it is in the missing buffer, remove it.
|
||||
//int missCounter = 0;
|
||||
if (in->seq > current->rxSeqBuf.lastKey() + 1) {
|
||||
qInfo(logUdpServer()) << current->ipAddress.toString() << "(" << current->type << "1 or more missing packets detected, previous: " <<
|
||||
QString("0x%1").arg(current->rxSeqBuf.lastKey(), 0, 16) << " current: " << QString("0x%1").arg(in->seq, 0, 16);
|
||||
// We are likely missing packets then!
|
||||
if (current->missMutex.try_lock_for(std::chrono::milliseconds(LOCK_PERIOD)))
|
||||
{
|
||||
|
@ -931,14 +933,11 @@ void udpServer::commonReceived(QList<CLIENT*>* l, CLIENT* current, QByteArray r)
|
|||
}
|
||||
current->rxSeqBuf.insert(f, QTime::currentTime());
|
||||
|
||||
if (f != in->seq) {
|
||||
if (!current->rxMissing.contains(f))
|
||||
if (f != in->seq && !current->rxMissing.contains(f))
|
||||
{
|
||||
qInfo(logUdpServer()) << "Detected new missing packet" << f;
|
||||
current->rxMissing.insert(f, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
current->missMutex.unlock();
|
||||
}
|
||||
else {
|
||||
|
|
Ładowanie…
Reference in New Issue