Added support for the do_inet semafore

This commit is contained in:
Michiel Broek
2002-02-02 15:15:34 +00:00
parent 03016abff7
commit 1a1586d651
7 changed files with 59 additions and 13 deletions

View File

@@ -100,6 +100,7 @@ extern int s_index; /* Compile nl semafore */
extern int s_newnews; /* New news semafore */
extern int s_reqindex; /* Create req index sem */
extern int s_msglink; /* Messages link sem */
extern int s_do_inet; /* Internet wanted */
int pingstate = P_INIT; /* Ping state */
int pingnr = 1; /* Ping #, 1 or 2 */
int pingresult[2]; /* Ping results */
@@ -533,6 +534,17 @@ int check_calllist(void)
sem_set((char *)"scanout", FALSE);
}
/*
* Check if we need to remove the do_inet semafore
*/
if (!inet_calls && s_do_inet) {
tasklog('c', "Removing do_inet semafore");
s_do_inet = FALSE;
if (IsSema((char *)"do_inet")) {
RemoveSema((char *)"do_inet");
}
}
call_work = 0;
for (i = 0; i < MAXTASKS; i++) {
if (calllist[i].addr.zone) {

View File

@@ -50,6 +50,7 @@ int isdn_calls; /* ISDN calls to make */
int pots_calls; /* POTS calls to make */
pp_list *pl = NULL; /* Portlist */
_alist_l *alist = NULL; /* Nodes to call list */
extern int s_do_inet; /* Internet wanted */
@@ -242,10 +243,22 @@ int outstat()
* If the node has internet and we have internet available, check if we can send
* immediatly.
*/
if (internet && TCFG.max_tcp &&
if (TCFG.max_tcp &&
(((tmp->flavors) & F_IMM) || ((tmp->flavors) & F_CRASH) || ((tmp->flavors) & F_NORMAL)) &&
((tmp->ipflags & IP_IBN) || (tmp->ipflags & IP_IFC) || (tmp->ipflags & IP_ITN))) {
tmp->flavors |= F_CALL;
/*
* If connection available, set callflag
*/
if (internet)
tmp->flavors |= F_CALL;
/*
* Always set semafore do_inet
*/
if (!s_do_inet) {
CreateSema((char *)"do_inet");
s_do_inet = TRUE;
tasklog('c', "Created semafore do_inet");
}
}
if ((tmp->flavors) & F_IMM ) {
flstr[0]='I';

View File

@@ -48,6 +48,7 @@ int s_index = FALSE;
int s_msglink = FALSE;
int s_newnews = FALSE;
int s_bbsopen = FALSE;
int s_do_inet = FALSE;
extern int UPSalarm;
extern int ptimer;
@@ -287,14 +288,14 @@ char *stat_status()
static char buf[160];
buf[0] = '\0';
sprintf(buf, "100:19,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%d,%d,%d,%d,%2.2f,%lu;",
sprintf(buf, "100:20,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%d,%d,%d,%d,%d,%2.2f,%lu;",
status.start, status.laststart, status.daily,
status.startups, status.clients,
status.total.tot_clt, status.total.peak_clt,
status.total.s_error, status.total.c_error,
status.today.tot_clt, status.today.peak_clt,
status.today.s_error, status.today.c_error,
status.open, get_zmh(), internet, Processing, Load, status.sequence);
status.open, get_zmh(), internet, s_do_inet, Processing, Load, status.sequence);
return buf;
}
@@ -351,6 +352,8 @@ int sem_set(char *sem, int value)
s_msglink = value;
} else if (!strcmp(sem, "reqindex")) {
s_reqindex = value;
} else if (!strcmp(sem, "do_inet")) {
s_do_inet = value;
} else {
return FALSE;
}
@@ -387,6 +390,8 @@ char *sem_status(char *data)
value = s_reqindex;
} else if (!strcmp(sem, "upsalarm")) {
value = UPSalarm;
} else if (!strcmp(sem, "do_inet")) {
value = s_do_inet;
} else {
tasklog('s', "sem_status(%s) buf=%s", sem, buf);
return buf;