Merge pull request #309 from g0wfv/develop
Changes to handling of master disconnects
This commit is contained in:
commit
9db7c252e9
|
@ -383,7 +383,7 @@ void CDMRNetwork::clock(unsigned int ms)
|
|||
}
|
||||
} else if (::memcmp(m_buffer, "MSTNAK", 6U) == 0) {
|
||||
if (m_status == RUNNING) {
|
||||
LogWarning("DMR, The master is restarting, logging back in");
|
||||
LogWarning("DMR, Login to the master has failed, retrying login ...");
|
||||
m_status = WAITING_LOGIN;
|
||||
m_timeoutTimer.start();
|
||||
m_retryTimer.start();
|
||||
|
@ -391,7 +391,7 @@ void CDMRNetwork::clock(unsigned int ms)
|
|||
/* Once the modem death spiral has been prevented in Modem.cpp
|
||||
the Network sometimes times out and reaches here.
|
||||
We want it to reconnect so... */
|
||||
LogError("DMR, Login to the master has failed, retrying ...");
|
||||
LogError("DMR, Login to the master has failed, retrying network ...");
|
||||
close();
|
||||
open();
|
||||
return;
|
||||
|
|
|
@ -95,6 +95,7 @@ int main(int argc, char** argv)
|
|||
}
|
||||
|
||||
#if !defined(_WIN32) && !defined(_WIN64)
|
||||
::signal(SIGINT, sigHandler);
|
||||
::signal(SIGTERM, sigHandler);
|
||||
::signal(SIGHUP, sigHandler);
|
||||
#endif
|
||||
|
@ -109,11 +110,14 @@ int main(int argc, char** argv)
|
|||
|
||||
delete host;
|
||||
|
||||
if (m_signal == 2)
|
||||
::LogInfo("MMDVMHost-%s exited on receipt of SIGINT", VERSION);
|
||||
|
||||
if (m_signal == 15)
|
||||
::LogInfo("Caught SIGTERM, exiting");
|
||||
::LogInfo("MMDVMHost-%s exited on receipt of SIGTERM", VERSION);
|
||||
|
||||
if (m_signal == 1)
|
||||
::LogInfo("Caught SIGHUP, restarting");
|
||||
::LogInfo("MMDVMHost-%s is restarting on receipt of SIGHUP", VERSION);
|
||||
} while (m_signal == 1);
|
||||
|
||||
::LogFinalise();
|
||||
|
@ -745,8 +749,6 @@ int CMMDVMHost::run()
|
|||
CThread::sleep(5U);
|
||||
}
|
||||
|
||||
LogMessage("MMDVMHost-%s is exiting on receipt of SIGHUP1", VERSION);
|
||||
|
||||
setMode(MODE_IDLE);
|
||||
|
||||
m_modem->close();
|
||||
|
|
Loading…
Reference in a new issue