Commits (1)
  • Rob Swindell's avatar
    Lower level of new "Logoff time <= logon time" log message · 141112e1
    Rob Swindell authored
    ... from ERROR to WARNING, but log the human-readable logon time too.
    
    This condition can easily happen if the system clock is corrected (e.g. a few seconds via NTP adjustment) during a quick connect/disconnect.
    
    Don't call logoffstats() unless a user actually successfully logged-in. I don't think sysops actually want all the time bots sit at the logon prompt counted as "time online" in their stats anyway.
    141112e1
...@@ -4239,7 +4239,9 @@ void sbbs_t::logoffstats() ...@@ -4239,7 +4239,9 @@ void sbbs_t::logoffstats()
now = time(NULL); now = time(NULL);
if(now <= logontime) { if(now <= logontime) {
lprintf(LOG_ERR, "Logoff time (%lu) <= logon time (%lu)", (ulong)now, (ulong)logontime); char tmp[128];
lprintf(LOG_WARNING, "Logoff time (%lu) <= logon time (%lu): %s"
,(ulong)now, (ulong)logontime, ctime_r(&logontime, tmp));
return; return;
} }
ulong minutes_used = (ulong)(now-logontime)/60; ulong minutes_used = (ulong)(now-logontime)/60;
...@@ -4367,6 +4369,7 @@ void node_thread(void* arg) ...@@ -4367,6 +4369,7 @@ void node_thread(void* arg)
node_socket[sbbs->cfg.node_num-1]=INVALID_SOCKET; node_socket[sbbs->cfg.node_num-1]=INVALID_SOCKET;
sbbs->logout(); sbbs->logout();
if(login_success)
sbbs->logoffstats(); /* Updates both system and node dsts.ini (daily statistics) files */ sbbs->logoffstats(); /* Updates both system and node dsts.ini (daily statistics) files */
SAFEPRINTF(str, "%sclient.ini", sbbs->cfg.node_dir); SAFEPRINTF(str, "%sclient.ini", sbbs->cfg.node_dir);
......