Added callstat timer, updated mbout node info
This commit is contained in:
parent
80cd689c19
commit
ad32ba68ff
@ -60,15 +60,26 @@ void putstatus(faddr *addr, int incr, int sts)
|
|||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
callstat *cst;
|
callstat *cst;
|
||||||
|
int j;
|
||||||
|
|
||||||
cst = getstatus(addr);
|
cst = getstatus(addr);
|
||||||
if ((fp = fopen(stsname(addr), "w"))) {
|
if ((fp = fopen(stsname(addr), "w"))) {
|
||||||
if (sts == 0)
|
if (sts == 0) {
|
||||||
cst->tryno = 0;
|
j = cst->tryno = 0;
|
||||||
else
|
} else {
|
||||||
cst->tryno += incr;
|
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->trystat = sts;
|
||||||
cst->trytime = time(NULL);
|
cst->trytime = time(NULL) + j;
|
||||||
|
|
||||||
fwrite(cst, sizeof(callstat), 1, fp);
|
fwrite(cst, sizeof(callstat), 1, fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
if (cst->tryno >= 30)
|
if (cst->tryno >= 30)
|
||||||
|
@ -73,7 +73,9 @@ int nlinfo(faddr *addr)
|
|||||||
for (i = 0; ikey[i].flag != 0; i++)
|
for (i = 0; ikey[i].flag != 0; i++)
|
||||||
if ((nlent->iflags & ikey[i].flag) == ikey[i].flag)
|
if ((nlent->iflags & ikey[i].flag) == ikey[i].flag)
|
||||||
sprintf(flagbuf + strlen(flagbuf), "%s,", ikey[i].key);
|
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) {
|
switch (nlent->xflags) {
|
||||||
case RQ_XA: sprintf(flagbuf + strlen(flagbuf), "XA"); break;
|
case RQ_XA: sprintf(flagbuf + strlen(flagbuf), "XA"); break;
|
||||||
|
Reference in New Issue
Block a user