From 43de18522ac080069896f6198dcfdb326f63f704 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Wed, 5 Jun 2002 19:30:31 +0000 Subject: [PATCH] Changed ping test scheduling --- ChangeLog | 3 +++ html/index.htm | 4 ++-- mbtask/mbtask.c | 45 +++++++++++++++++++++++++++------------------ mbtask/ping.c | 2 +- mbtask/ports.c | 5 ++--- 5 files changed, 35 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index c2c4ee7e..552bdf07 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,9 @@ $Id$ 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 diff --git a/html/index.htm b/html/index.htm index 85593f36..808a3707 100755 --- a/html/index.htm +++ b/html/index.htm @@ -13,10 +13,10 @@
-

MBSE BBS System Guide v0.33.20

+

MBSE BBS System Guide v0.35.01


-
Last update 11-May-2002
+
Last update 05-Jun-2002

diff --git a/mbtask/mbtask.c b/mbtask/mbtask.c index b820f9f4..5bba856e 100644 --- a/mbtask/mbtask.c +++ b/mbtask/mbtask.c @@ -1031,8 +1031,23 @@ void scheduler(void) } } + /* + * Check system processing state + */ 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 * once each second. @@ -1043,11 +1058,6 @@ void scheduler(void) ptimer--; } - if (!Processing) { - tasklog('+', "Resuming normal operations"); - Processing = TRUE; - } - /* * Here we run all normal operations. */ @@ -1107,14 +1117,17 @@ void scheduler(void) s_reqindex = FALSE; } - if ((tm->tm_sec / SLOWRUN) != oldmin) { + } /* if (Processing) */ - /* - * These tasks run once per 20 seconds. - */ - oldmin = tm->tm_sec / SLOWRUN; + if ((tm->tm_sec / SLOWRUN) != oldmin) { - check_ping(); + /* + * These tasks run once per 20 seconds. + */ + oldmin = tm->tm_sec / SLOWRUN; + check_ping(); + + if (Processing) { /* * Update outbound status if needed. @@ -1206,19 +1219,15 @@ void scheduler(void) cmd = NULL; } } - } + } /* if (Processing) */ /* * PING state changes */ state_ping(); - } else { - if (Processing) { - tasklog('+', "Suspending operations"); - Processing = FALSE; - } - } + } /* if ((tm->tm_sec / SLOWRUN) != oldmin) */ + } while (TRUE); } diff --git a/mbtask/ping.c b/mbtask/ping.c index 3dadfc26..79434131 100644 --- a/mbtask/ping.c +++ b/mbtask/ping.c @@ -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) { diff --git a/mbtask/ports.c b/mbtask/ports.c index 21feceea..d5f1c899 100644 --- a/mbtask/ports.c +++ b/mbtask/ports.c @@ -67,7 +67,6 @@ void tidy_portlist(pp_list ** fdp) { pp_list *tmp, *old; - tasklog('p', "tidy_portlist"); for (tmp = *fdp; tmp; tmp = old) { old = tmp->next; free(tmp); @@ -121,7 +120,6 @@ void load_ports() } fread(&ttyinfohdr, sizeof(ttyinfohdr), 1, fp); - tasklog('p', "Building portlist..."); pots_lines = isdn_lines = 0; while (fread(&ttyinfo, ttyinfohdr.recsize, 1, fp) == 1) { @@ -159,7 +157,8 @@ void load_ports() fclose(fp); 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"); }