Skip to content
Snippets Groups Projects
Commit 41af8b34 authored by rswindell's avatar rswindell
Browse files

Fix a long standing-bug where if the "inactivity hangup" timeout value is set

*lower* than the "inactivity warning" timeout value, the hangup timer wouldn't
actually take effect until after the warning timeout elapsed. This made the
login.js modification (rev 1.14) where we reduce the hangup timeout (by 75%)
when an ANSI terminal is not detected, not effective.
parent dc49cd42
Branches
Tags
No related merge requests found
......@@ -263,27 +263,27 @@ char sbbs_t::getkey(long mode)
}
if(online==ON_REMOTE && !(console&CON_NO_INACT)
&& now-timeout>=cfg.sec_warn) { /* warning */
if(sys_status&SS_USERON && cfg.sec_warn!=cfg.sec_hangup) {
&& (now-timeout >= cfg.sec_warn || now-timeout >= cfg.sec_hangup)) {
if(sys_status&SS_USERON && cfg.sec_warn < cfg.sec_hangup) {
SAVELINE;
bputs(text[AreYouThere]);
}
else
bputs("\7\7");
while(!inkey(K_NONE,100) && online && now-timeout>=cfg.sec_warn) {
while(!inkey(K_NONE,100) && online && now-timeout < cfg.sec_hangup) {
now=time(NULL);
if(now-timeout>=cfg.sec_hangup) {
if(online==ON_REMOTE) {
console|=CON_R_ECHO;
console&=~CON_R_ECHOX;
}
bputs(text[CallBackWhenYoureThere]);
logline(LOG_NOTICE,nulstr,"Inactive");
hangup();
return(0);
}
if(now-timeout >= cfg.sec_hangup) {
if(online==ON_REMOTE) {
console|=CON_R_ECHO;
console&=~CON_R_ECHOX;
}
bputs(text[CallBackWhenYoureThere]);
logline(LOG_NOTICE,nulstr,"Inactive");
hangup();
return(0);
}
if(sys_status&SS_USERON && cfg.sec_warn!=cfg.sec_hangup) {
if(sys_status&SS_USERON) {
bputs("\r\1n\1>");
RESTORELINE;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment