FS-6356: --resolve fix assert when you set the time > 15 days in the future during operation while things are in queue to be processeed

This commit is contained in:
Michael Jerris 2014-03-28 14:33:47 -04:00
parent 0fe2039219
commit f50f04be51

View File

@ -1280,17 +1280,15 @@ void agent_timer(su_root_magic_t *rm, su_timer_t *timer, nta_agent_t *agent)
if (next == latest) { if (next == latest) {
/* Do not set timer? */ /* Do not set timer? */
SU_DEBUG_9(("nta: timer not set\n" VA_NONE)); /* check it there are still things queued, if there are, that means everything scheduled is > 15 days in the future */
assert(!agent->sa_out.completed->q_head); /* in this case, we had a large time shift, we should schedule for 15 days in the future (which is probably still before now) */
assert(!agent->sa_out.trying->q_head); /* and this should sort itself out on the next run through */
assert(!agent->sa_out.inv_calling->q_head); if ( !agent->sa_out.completed->q_head && !agent->sa_out.trying->q_head && !agent->sa_out.inv_calling->q_head &&
assert(!agent->sa_out.re_list); !agent->sa_out.re_list && !agent->sa_in.inv_confirmed->q_head && !agent->sa_in.preliminary->q_head &&
assert(!agent->sa_in.inv_confirmed->q_head); !agent->sa_in.completed->q_head && !agent->sa_in.inv_completed->q_head && !agent->sa_in.re_list ) {
assert(!agent->sa_in.preliminary->q_head); SU_DEBUG_9(("nta: timer not set\n" VA_NONE));
assert(!agent->sa_in.completed->q_head); return;
assert(!agent->sa_in.inv_completed->q_head); }
assert(!agent->sa_in.re_list);
return;
} }
if (next == now) if (++next == 0) ++next; if (next == now) if (++next == 0) ++next;