Changed ping test scheduling

This commit is contained in:
Michiel Broek 2002-06-05 19:30:31 +00:00
parent f781ff6b71
commit 43de18522a
5 changed files with 35 additions and 24 deletions

View File

@ -4,6 +4,9 @@ $Id$
v0.35.01 05-Jun-2002 v0.35.01 05-Jun-2002
mbtask:
Removed some debug logging and corrected some spelling.
The ping test now also works if operations are suspended.
v0.33.21 04-Jun-2002 v0.33.21 04-Jun-2002

View File

@ -13,10 +13,10 @@
<BODY> <BODY>
<BLOCKQUOTE> <BLOCKQUOTE>
<center><img SRC="images/mbse.jpg" BORDER=0></center> <center><img SRC="images/mbse.jpg" BORDER=0></center>
<div align=center><h1>MBSE BBS System Guide v0.33.20</h1></div> <div align=center><h1>MBSE BBS System Guide v0.35.01</h1></div>
<HR> <HR>
<div align=right><h5>Last update 11-May-2002</h5></div> <div align=right><h5>Last update 05-Jun-2002</h5></div>
<P> <P>

View File

@ -1031,8 +1031,23 @@ void scheduler(void)
} }
} }
/*
* Check system processing state
*/
if (s_bbsopen && !UPSalarm && !LOADhi) { if (s_bbsopen && !UPSalarm && !LOADhi) {
if (!Processing) {
tasklog('+', "Resuming normal operations");
Processing = TRUE;
}
} else {
if (Processing) {
tasklog('+', "Suspending operations");
Processing = FALSE;
}
}
if (Processing) {
/* /*
* Check Pause Timer, make sure it's only checked * Check Pause Timer, make sure it's only checked
* once each second. * once each second.
@ -1043,11 +1058,6 @@ void scheduler(void)
ptimer--; ptimer--;
} }
if (!Processing) {
tasklog('+', "Resuming normal operations");
Processing = TRUE;
}
/* /*
* Here we run all normal operations. * Here we run all normal operations.
*/ */
@ -1107,14 +1117,17 @@ void scheduler(void)
s_reqindex = FALSE; s_reqindex = FALSE;
} }
if ((tm->tm_sec / SLOWRUN) != oldmin) { } /* if (Processing) */
/* if ((tm->tm_sec / SLOWRUN) != oldmin) {
* These tasks run once per 20 seconds.
*/
oldmin = tm->tm_sec / SLOWRUN;
check_ping(); /*
* These tasks run once per 20 seconds.
*/
oldmin = tm->tm_sec / SLOWRUN;
check_ping();
if (Processing) {
/* /*
* Update outbound status if needed. * Update outbound status if needed.
@ -1206,19 +1219,15 @@ void scheduler(void)
cmd = NULL; cmd = NULL;
} }
} }
} } /* if (Processing) */
/* /*
* PING state changes * PING state changes
*/ */
state_ping(); state_ping();
} else { } /* if ((tm->tm_sec / SLOWRUN) != oldmin) */
if (Processing) {
tasklog('+', "Suspending operations");
Processing = FALSE;
}
}
} while (TRUE); } while (TRUE);
} }

View File

@ -401,7 +401,7 @@ void state_ping(void)
/* /*
* Create the ping socket, called from main() durig init as root. * Create the ping socket, called from main() during init as root.
*/ */
void init_pingsocket(void) void init_pingsocket(void)
{ {

View File

@ -67,7 +67,6 @@ void tidy_portlist(pp_list ** fdp)
{ {
pp_list *tmp, *old; pp_list *tmp, *old;
tasklog('p', "tidy_portlist");
for (tmp = *fdp; tmp; tmp = old) { for (tmp = *fdp; tmp; tmp = old) {
old = tmp->next; old = tmp->next;
free(tmp); free(tmp);
@ -121,7 +120,6 @@ void load_ports()
} }
fread(&ttyinfohdr, sizeof(ttyinfohdr), 1, fp); fread(&ttyinfohdr, sizeof(ttyinfohdr), 1, fp);
tasklog('p', "Building portlist...");
pots_lines = isdn_lines = 0; pots_lines = isdn_lines = 0;
while (fread(&ttyinfo, ttyinfohdr.recsize, 1, fp) == 1) { while (fread(&ttyinfo, ttyinfohdr.recsize, 1, fp) == 1) {
@ -159,7 +157,8 @@ void load_ports()
fclose(fp); fclose(fp);
tty_time = file_time(ttyfn); tty_time = file_time(ttyfn);
tasklog('+', "Detected %d modem ports and %d ISDN ports", pots_lines, isdn_lines); tasklog('+', "Detected %d modem port%s and %d ISDN port%s",
pots_lines, (pots_lines == 1)?"":"s", isdn_lines, (isdn_lines == 1)?"":"s");
} }