]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Revert "Add the ability to add timers relative to el->now"
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 4 Dec 2019 00:49:00 +0000 (07:49 +0700)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 4 Dec 2019 07:04:34 +0000 (14:04 +0700)
This reverts commit d60355fc4b9ad8163f9637d9b23f1247edee6894.

src/lib/util/event.c
src/lib/util/event.h

index 178463e38a86bd60d334291043e81b8b7c1eaa51..2e3ece37a098cf3671326eb99443ffc8298723d7 100644 (file)
@@ -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
index 032fe28c687537cb4d3543ccc212b1417ee28857..695bc088a6a2e47aae26b3ddb2cdd54c9b62ee81 100644 (file)
@@ -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