Added callstat timer, updated mbout node info

This commit is contained in:
Michiel Broek 2001-12-30 19:14:55 +00:00
parent 80cd689c19
commit ad32ba68ff
2 changed files with 39 additions and 26 deletions

View File

@ -60,15 +60,26 @@ void putstatus(faddr *addr, int incr, int sts)
{
FILE *fp;
callstat *cst;
int j;
cst = getstatus(addr);
if ((fp = fopen(stsname(addr), "w"))) {
if (sts == 0)
cst->tryno = 0;
else
if (sts == 0) {
j = cst->tryno = 0;
} else {
cst->tryno += incr;
srand(getpid());
while (TRUE) {
j = 1+(int) (1.0 * CFG.dialdelay * rand() / (RAND_MAX + 1.0));
if ((j > (CFG.dialdelay / 10)) && (j > 9))
break;
}
Syslog('d', "Next call allowed over %d seconds", j);
}
cst->trystat = sts;
cst->trytime = time(NULL);
cst->trytime = time(NULL) + j;
fwrite(cst, sizeof(callstat), 1, fp);
fclose(fp);
if (cst->tryno >= 30)

View File

@ -73,7 +73,9 @@ int nlinfo(faddr *addr)
for (i = 0; ikey[i].flag != 0; i++)
if ((nlent->iflags & ikey[i].flag) == ikey[i].flag)
sprintf(flagbuf + strlen(flagbuf), "%s,", ikey[i].key);
for (i = 0; okey[i].flag != 0; i++)
if ((nlent->oflags & okey[i].flag) == okey[i].flag)
sprintf(flagbuf + strlen(flagbuf), "%s,", okey[i].key);
switch (nlent->xflags) {
case RQ_XA: sprintf(flagbuf + strlen(flagbuf), "XA"); break;