mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-02-10 06:13:20 -05:00
more time_t
git-svn-id: file:///svn/unbound/trunk@2947 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
05a9730e53
commit
50e68cbcda
1 changed files with 9 additions and 9 deletions
|
|
@ -1450,21 +1450,21 @@ update_events(struct module_env* env, struct val_env* ve,
|
|||
* @param holddown: the timer value
|
||||
* @return number of seconds the holddown has passed.
|
||||
*/
|
||||
static int
|
||||
check_holddown(struct module_env* env, struct autr_ta* ta,
|
||||
static time_t
|
||||
check_holddown(struct module_env* env, struct autr_ta* ta,
|
||||
unsigned int holddown)
|
||||
{
|
||||
unsigned int elapsed;
|
||||
if((unsigned)*env->now < (unsigned)ta->last_change) {
|
||||
time_t elapsed;
|
||||
if(*env->now < ta->last_change) {
|
||||
log_warn("time goes backwards. delaying key holddown");
|
||||
return 0;
|
||||
}
|
||||
elapsed = (unsigned)*env->now - (unsigned)ta->last_change;
|
||||
if (elapsed > holddown) {
|
||||
return (int) (elapsed-holddown);
|
||||
elapsed = *env->now - ta->last_change;
|
||||
if (elapsed > (time_t)holddown) {
|
||||
return elapsed-(time_t)holddown;
|
||||
}
|
||||
verbose_key(ta, VERB_ALGO, "holddown time %d seconds to go",
|
||||
(int) (holddown-elapsed));
|
||||
verbose_key(ta, VERB_ALGO, "holddown time %lld seconds to go",
|
||||
(long long) ((time_t)holddown-elapsed));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue