Differentiate between the E2E and P2P delay timeout intervals.

We have one timer used for both delay request mechanisms, and we ought
to set the message interval accordingly.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2012-09-01 12:28:15 +02:00
parent ace0d71a80
commit c06f3adc84
1 changed files with 6 additions and 1 deletions

7
port.c
View File

@ -379,7 +379,12 @@ static int port_set_delay_tmo(struct port *p)
struct itimerspec tmo = { struct itimerspec tmo = {
{0, 0}, {0, 0} {0, 0}, {0, 0}
}; };
int index = random() % TMTAB_MAX; int index;
if (p->delayMechanism == DM_P2P) {
return set_tmo(p->fda.fd[FD_DELAY_TIMER], 1,
p->logMinPdelayReqInterval);
}
index = random() % TMTAB_MAX;
tmo.it_value = p->tmtab.ts[index]; tmo.it_value = p->tmtab.ts[index];
return timerfd_settime(p->fda.fd[FD_DELAY_TIMER], 0, &tmo, NULL); return timerfd_settime(p->fda.fd[FD_DELAY_TIMER], 0, &tmo, NULL);
} }