Actually stop the data if blocked.
This commit is contained in:
parent
1a81c4a003
commit
39f2dc9a0d
1 changed files with 15 additions and 8 deletions
|
@ -200,12 +200,16 @@ void CYSFReflector::run()
|
||||||
unsigned char dst[YSF_CALLSIGN_LENGTH];
|
unsigned char dst[YSF_CALLSIGN_LENGTH];
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
bool blocked;
|
||||||
|
|
||||||
unsigned char buffer[200U];
|
unsigned char buffer[200U];
|
||||||
sockaddr_storage addr;
|
sockaddr_storage addr;
|
||||||
unsigned int addrLen;
|
unsigned int addrLen;
|
||||||
|
|
||||||
unsigned int len = network.readData(buffer, 200U, addr, addrLen);
|
unsigned int len = network.readData(buffer, 200U, addr, addrLen);
|
||||||
if (len > 0U) {
|
if (len > 0U) {
|
||||||
|
blocked = false;
|
||||||
|
|
||||||
CYSFRepeater* rpt = findRepeater(addr);
|
CYSFRepeater* rpt = findRepeater(addr);
|
||||||
if (::memcmp(buffer, "YSFP", 4U) == 0) {
|
if (::memcmp(buffer, "YSFP", 4U) == 0) {
|
||||||
if (rpt == NULL) {
|
if (rpt == NULL) {
|
||||||
|
@ -271,8 +275,10 @@ void CYSFReflector::run()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LogDebug("Data from %10.10s at %10.10s blocked", buffer + 14U, buffer + 4U);
|
LogDebug("Data from %10.10s at %10.10s blocked", buffer + 14U, buffer + 4U);
|
||||||
|
blocked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!blocked) {
|
||||||
watchdogTimer.start();
|
watchdogTimer.start();
|
||||||
|
|
||||||
for (std::vector<CYSFRepeater*>::const_iterator it = m_repeaters.begin(); it != m_repeaters.end(); ++it) {
|
for (std::vector<CYSFRepeater*>::const_iterator it = m_repeaters.begin(); it != m_repeaters.end(); ++it) {
|
||||||
|
@ -286,6 +292,7 @@ void CYSFReflector::run()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int ms = stopWatch.elapsed();
|
unsigned int ms = stopWatch.elapsed();
|
||||||
stopWatch.start();
|
stopWatch.start();
|
||||||
|
|
Loading…
Add table
Reference in a new issue