Some small updates

This commit is contained in:
Michiel Broek 2003-02-12 20:20:59 +00:00
parent 75831ac20c
commit 8def403243
7 changed files with 58 additions and 56 deletions

View File

@ -54,6 +54,8 @@ v0.37.01 14-Jan-2003.
Added experimental code where tossing mail is not started as Added experimental code where tossing mail is not started as
long as there are mailers running, but not longer as 30 mins. long as there are mailers running, but not longer as 30 mins.
This should make the whole system less nervous. This should make the whole system less nervous.
Modified this code, didn't work, the toss was always started
at once.
mbfile: mbfile:
In the import function several bugfixes for reading files.bbs. In the import function several bugfixes for reading files.bbs.
@ -66,6 +68,11 @@ v0.37.01 14-Jan-2003.
The nodes statistocs are expanded with flow counters. The nodes statistocs are expanded with flow counters.
If echomail is accepted in a unsecure area or the unsecure If echomail is accepted in a unsecure area or the unsecure
commandline option is set, a violation is logged as warning. commandline option is set, a violation is logged as warning.
Removed some debugging tests and log messages.
mbdiff:
If unpacking a diff file fails, a second attempt is done after
a sync and one second delay.
mbsetup: mbsetup:
Added protection against wrong database sizes depending on Added protection against wrong database sizes depending on

View File

@ -296,13 +296,18 @@ int main(int argc, char **argv)
} }
if (execute(cmd, nd, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null")) { if (execute(cmd, nd, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null")) {
show_log = TRUE; Syslog('!', "Warning: unpack error, trying again after a sync");
free(cmd); sync();
free(onl); sleep(1);
free(wrk); if (execute(cmd, nd, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null")) {
free(ond); show_log = TRUE;
WriteError("Unpack error"); free(cmd);
die(MBERR_EXEC_FAILED); free(onl);
free(wrk);
free(ond);
WriteError("Fatal: unpack error");
die(MBERR_EXEC_FAILED);
}
} }
free(cmd); free(cmd);
sync(); sync();

View File

@ -144,7 +144,7 @@ int postecho(faddr *p_from, faddr *f, faddr *t, char *orig, char *subj, time_t m
{ {
char *buf, *msgid = NULL, *reply = NULL, *p, *q, sbe[16]; char *buf, *msgid = NULL, *reply = NULL, *p, *q, sbe[16];
int First = TRUE, rc = 0, i, kludges = TRUE, dupe = FALSE, bad = TRUE, seenlen, oldnet; int First = TRUE, rc = 0, i, kludges = TRUE, dupe = FALSE, bad = TRUE, seenlen, oldnet;
faddr *Faddr, *ta; faddr *Faddr;
unsigned long crc; unsigned long crc;
sysconnect Link; sysconnect Link;
fa_list *sbl = NULL, *ptl = NULL, *tmpl; fa_list *sbl = NULL, *ptl = NULL, *tmpl;
@ -221,28 +221,13 @@ int postecho(faddr *p_from, faddr *f, faddr *t, char *orig, char *subj, time_t m
} }
if (!strncmp(buf, "\001MSGID: ", 8)) { if (!strncmp(buf, "\001MSGID: ", 8)) {
msgid = xstrcpy(buf + 8); msgid = xstrcpy(buf + 8);
/*
* Extra test to see if the address is correct, only logging.
*/
p = strtok(buf, " \n");
p = strtok(NULL, " \n");
if ((ta = parsefnode(p))) {
if ((ta->zone != f->zone) || (ta->point != f->point) || (ta->node != f->node) || (ta->net != f->net)) {
p = xstrcpy(ascfnode(f, 0x1f));
Syslog('!', "ERROR: origin=%s, msgid=%s", p, ascfnode(ta, 0x1f));
free(p);
}
}
} }
if (!strncmp(buf, "\001REPLY: ", 8)) if (!strncmp(buf, "\001REPLY: ", 8))
reply = xstrcpy(buf + 8); reply = xstrcpy(buf + 8);
if (!strncmp(buf, "SEEN-BY:", 8)) { if (!strncmp(buf, "SEEN-BY:", 8)) {
// if (Link.aka.zone == msgs.Aka.zone) { p = xstrcpy(buf + 9);
p = xstrcpy(buf + 9); fill_list(&sbl, p, NULL);
fill_list(&sbl, p, NULL); free(p);
free(p);
// } else
// Syslog('m', "Strip zone SB lines");
} }
if (!strncmp(buf, "\001PATH:", 6)) { if (!strncmp(buf, "\001PATH:", 6)) {
p = xstrcpy(buf + 7); p = xstrcpy(buf + 7);

View File

@ -104,6 +104,7 @@ extern int pots_free; /* POTS lines free */
extern int isdn_free; /* ISDN lines free */ extern int isdn_free; /* ISDN lines free */
extern pp_list *pl; /* List of tty ports */ extern pp_list *pl; /* List of tty ports */
extern int ipmailers; /* TCP/IP mail sessions */ extern int ipmailers; /* TCP/IP mail sessions */
extern int tosswait; /* Toss wait timer */
@ -839,7 +840,7 @@ void scheduler(void)
{ {
struct passwd *pw; struct passwd *pw;
int running = 0, rc, i, rlen, found; int running = 0, rc, i, rlen, found;
static int LOADhi = FALSE, oldmin = 70, olddo = 70, oldsec = 70, tosswait = TOSSWAIT_TIME; static int LOADhi = FALSE, oldmin = 70, olddo = 70, oldsec = 70;
char *cmd = NULL, opts[41], port[21]; char *cmd = NULL, opts[41], port[21];
static char doing[32], buf[2048]; static char doing[32], buf[2048];
time_t now; time_t now;

View File

@ -12,7 +12,6 @@
#define SLOWRUN 20 #define SLOWRUN 20
#define TMPNAME "TMP." #define TMPNAME "TMP."
#define LCKNAME "LOCKTASK" #define LCKNAME "LOCKTASK"
#define TOSSWAIT_TIME 30

View File

@ -4,7 +4,7 @@
* Purpose ...............: Keep track of server status * Purpose ...............: Keep track of server status
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2003
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -51,12 +51,12 @@ int s_msglink = FALSE;
int s_newnews = FALSE; int s_newnews = FALSE;
int s_bbsopen = FALSE; int s_bbsopen = FALSE;
int s_do_inet = FALSE; int s_do_inet = FALSE;
int tosswait = TOSSWAIT_TIME;
extern int UPSalarm; extern int UPSalarm;
extern int ptimer; extern int ptimer;
extern int rescan; extern int rescan;
extern struct taskrec TCFG; extern struct taskrec TCFG;
extern int internet; extern int internet;
extern int ZMH; extern int ZMH;
@ -340,31 +340,33 @@ char *getseq(void)
int sem_set(char *sem, int value) int sem_set(char *sem, int value)
{ {
Syslog('s', "%s semafore \"%s\"", value?"Set":"Clear", sem); Syslog('s', "%s semafore \"%s\"", value?"Set":"Clear", sem);
if (!strcmp(sem, "scanout")) { if (!strcmp(sem, "scanout")) {
s_scanout = value; s_scanout = value;
if (value) if (value)
rescan = TRUE; rescan = TRUE;
} else if (!strcmp(sem, "mailout")) { } else if (!strcmp(sem, "mailout")) {
s_mailout = value; s_mailout = value;
} else if (!strcmp(sem, "mailin")) { } else if (!strcmp(sem, "mailin")) {
s_mailin = value; s_mailin = value;
} else if (!strcmp(sem, "mbindex")) { if (value)
s_index = value; tosswait = TOSSWAIT_TIME;
} else if (!strcmp(sem, "newnews")) { } else if (!strcmp(sem, "mbindex")) {
s_newnews = value; s_index = value;
} else if (!strcmp(sem, "msglink")) { } else if (!strcmp(sem, "newnews")) {
s_msglink = value; s_newnews = value;
} else if (!strcmp(sem, "reqindex")) { } else if (!strcmp(sem, "msglink")) {
s_reqindex = value; s_msglink = value;
} else if (!strcmp(sem, "do_inet")) { } else if (!strcmp(sem, "reqindex")) {
s_do_inet = value; s_reqindex = value;
} else { } else if (!strcmp(sem, "do_inet")) {
return FALSE; s_do_inet = value;
} } else {
ptimer = PAUSETIME; return FALSE;
return TRUE; }
ptimer = PAUSETIME;
return TRUE;
} }

View File

@ -1,9 +1,12 @@
/* $Id$ */
#ifndef _TASKSTAT_H #ifndef _TASKSTAT_H
#define _TASKSTAT_H #define _TASKSTAT_H
/* $Id$ */
#define PAUSETIME 3 #define PAUSETIME 3
#define TOSSWAIT_TIME 30
void status_init(void); /* Initialize status module */ void status_init(void); /* Initialize status module */
void stat_inc_clients(void); /* Increase connected clients */ void stat_inc_clients(void); /* Increase connected clients */