From: Arran Cudbard-Bell Date: Wed, 4 Dec 2019 00:49:00 +0000 (+0700) Subject: Revert "Add the ability to add timers relative to el->now" X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=992fa66b5cbd325ce2903b069eccf91332f43dca;p=thirdparty%2Ffreeradius-server.git Revert "Add the ability to add timers relative to el->now" This reverts commit d60355fc4b9ad8163f9637d9b23f1247edee6894. --- diff --git a/src/lib/util/event.c b/src/lib/util/event.c index 178463e38a8..2e3ece37a09 100644 --- a/src/lib/util/event.c +++ b/src/lib/util/event.c @@ -298,9 +298,6 @@ struct fr_event_list { int exit; //!< If non-zero, the event loop will exit after its current ///< iteration, returning this value. - bool timers_relative; //!< All new 'in' timer events, are inserted relative - ///< to el->now. - fr_time_t now; //!< The last time the event list was serviced. bool dispatch; //!< Whether the event list is currently dispatching events. @@ -1128,12 +1125,7 @@ int fr_event_timer_in(TALLOC_CTX *ctx, fr_event_list_t *el, fr_event_timer_t con { fr_time_t now; - /* - * Sometimes we need everything to be relative - * to the last time the corral function was - * called (for testing purposes). - */ - now = !el->timers_relative ? fr_time() : el->now; + now = fr_time(); now += delta; return fr_event_timer_at(ctx, el, ev_p, now, callback, uctx); @@ -1791,15 +1783,6 @@ int fr_event_loop(fr_event_list_t *el) return el->exit; } -/** All deltas are calculated from the last value of el->now - * - * @param[in] el to modify. - */ -void fr_event_list_relative_mode(fr_event_list_t *el) -{ - el->timers_relative = true; -} - /** Cleanup an event list * * Frees/destroys any resources associated with an event list diff --git a/src/lib/util/event.h b/src/lib/util/event.h index 032fe28c687..695bc088a6a 100644 --- a/src/lib/util/event.h +++ b/src/lib/util/event.h @@ -237,7 +237,6 @@ void fr_event_loop_exit(fr_event_list_t *el, int code); bool fr_event_loop_exiting(fr_event_list_t *el); int fr_event_loop(fr_event_list_t *el); -void fr_event_list_relative_mode(fr_event_list_t *el); fr_event_list_t *fr_event_list_alloc(TALLOC_CTX *ctx, fr_event_status_cb_t status, void *status_ctx); #ifdef __cplusplus