mirror of
https://github.com/ShaYmez/NXDNClients.git
synced 2025-04-12 06:18:27 -04:00
Fix bugs.
This commit is contained in:
parent
3d30aadef1
commit
26427333c6
NXDNGateway
@ -287,7 +287,7 @@ void CNXDNGateway::run()
|
||||
unsigned int len = remoteNetwork.readData(buffer, 200U, addr, addrLen);
|
||||
if (len > 0U) {
|
||||
// If we're linked and it's from the right place, send it on
|
||||
if (currentTG > 0U && CUDPSocket::match(currentAddr, addr)) {
|
||||
if (currentAddrLen > 0U && CUDPSocket::match(currentAddr, addr)) {
|
||||
// Don't pass reflector control data through to the MMDVM
|
||||
if (::memcmp(buffer, "NXDND", 5U) == 0) {
|
||||
unsigned short dstTG = 0U;
|
||||
@ -349,7 +349,7 @@ void CNXDNGateway::run()
|
||||
dstTG |= (buffer[11U] << 0) & 0x00FFU;
|
||||
|
||||
if (dstTG != currentTG) {
|
||||
if (currentTG > 0U) {
|
||||
if (currentAddrLen > 0U) {
|
||||
std::string callsign = lookup->find(srcId);
|
||||
LogMessage("Unlinking from reflector %u by %s", currentTG, callsign.c_str());
|
||||
|
||||
@ -370,9 +370,6 @@ void CNXDNGateway::run()
|
||||
}
|
||||
}
|
||||
|
||||
currentTG = 0U;
|
||||
currentAddrLen = 0U;
|
||||
|
||||
if (found == NULL) {
|
||||
CNXDNReflector* refl = reflectors.find(dstTG);
|
||||
if (refl != NULL) {
|
||||
@ -380,6 +377,10 @@ void CNXDNGateway::run()
|
||||
currentAddr = refl->m_addr;
|
||||
currentAddrLen = refl->m_addrLen;
|
||||
currentIsStatic = false;
|
||||
} else {
|
||||
currentTG = dstTG;
|
||||
currentAddrLen = 0U;
|
||||
currentIsStatic = false;
|
||||
}
|
||||
} else {
|
||||
currentTG = found->m_tg;
|
||||
@ -404,7 +405,7 @@ void CNXDNGateway::run()
|
||||
}
|
||||
|
||||
if (voice != NULL) {
|
||||
if (currentTG == 0U)
|
||||
if (currentAddrLen == 0U)
|
||||
voice->unlinked();
|
||||
else
|
||||
voice->linkedTo(currentTG);
|
||||
@ -442,7 +443,7 @@ void CNXDNGateway::run()
|
||||
}
|
||||
|
||||
// If we're linked and we have a network, send it on
|
||||
if (currentTG > 0U) {
|
||||
if (currentAddrLen > 0U) {
|
||||
remoteNetwork.writeData(buffer, len, srcId, dstTG, grp, currentAddr, currentAddrLen);
|
||||
hangTimer.start();
|
||||
}
|
||||
@ -466,7 +467,9 @@ void CNXDNGateway::run()
|
||||
|
||||
hangTimer.clock(ms);
|
||||
if (hangTimer.isRunning() && hangTimer.hasExpired()) {
|
||||
if (currentTG > 0U) {
|
||||
currentTG = 0U;
|
||||
|
||||
if (currentAddrLen > 0U) {
|
||||
LogMessage("Unlinking from %u due to inactivity", currentTG);
|
||||
|
||||
if (!currentIsStatic) {
|
||||
@ -478,7 +481,6 @@ void CNXDNGateway::run()
|
||||
if (voice != NULL)
|
||||
voice->unlinked();
|
||||
|
||||
currentTG = 0U;
|
||||
currentAddrLen = 0U;
|
||||
|
||||
hangTimer.stop();
|
||||
|
@ -19,6 +19,6 @@
|
||||
#if !defined(VERSION_H)
|
||||
#define VERSION_H
|
||||
|
||||
const char* VERSION = "20201026";
|
||||
const char* VERSION = "20201027";
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user