1
0
Fork 0

Simplify the link reversion logic.

ycs232-kbc
Jonathan Naylor 8 years ago committed by GitHub
parent d6c3f0fe32
commit e3827bbd1b

@ -346,12 +346,13 @@ int CYSFGateway::run()
inactivityTimer.clock(ms);
if (inactivityTimer.isRunning() && inactivityTimer.hasExpired()) {
if (m_linked) {
if (revert) {
CYSFReflector* reflector = m_wiresX->getReflector(startup);
CYSFReflector* reflector = NULL;
if (revert && !startup.empty() && m_wiresX != NULL)
reflector = m_wiresX->getReflector(startup);
if (reflector != NULL) {
LogMessage("Reverting connection to %s", reflector->m_id.c_str());
LogMessage("Reverting connection to %5.5s", reflector->m_id.c_str());
if (m_wiresX != NULL)
m_wiresX->processConnect(reflector);
m_netNetwork->writeUnlink();
@ -379,22 +380,6 @@ int CYSFGateway::run()
lostTimer.stop();
pollTimer.stop();
m_linked = false;
}
} else {
LogMessage("Disconnecting due to inactivity");
if (m_wiresX != NULL)
m_wiresX->processDisconnect();
m_netNetwork->writeUnlink();
m_netNetwork->writeUnlink();
m_netNetwork->writeUnlink();
m_netNetwork->clearDestination();
lostTimer.stop();
pollTimer.stop();
m_linked = false;
}
}

Loading…
Cancel
Save