only a single log line per client version mismatch

This commit is contained in:
Stephen Birarda 2016-04-04 09:46:10 -07:00
parent 278fe93f2b
commit 1da8fe5838

View file

@ -62,7 +62,14 @@ bool IceServer::packetVersionMatch(const udt::Packet& packet) {
if (headerVersion == versionForPacketType(headerType)) {
return true;
} else {
qDebug() << "Packet version mismatch for packet" << headerType << " from" << packet.getSenderSockAddr();
static QSet<HifiSockAddr> mismatchedClients;
// only output a version mismatch once per ice-server run
if (!mismatchedClients.contains(packet.getSenderSockAddr())) {
mismatchedClients.insert(packet.getSenderSockAddr());
qDebug() << "Packet version mismatch for packet" << headerType << " from" << packet.getSenderSockAddr();
}
return false;
}