diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-01-05 09:24:34 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-01-05 09:24:34 -0500 |
commit | 2d92f4c19a151157b81091d352d59e4f72810542 (patch) | |
tree | 9bc4cc6a071c364ec14bdf1d6aae1ef1bf0520a3 /src/or/main.c | |
parent | 1dab8bae21bc32e5d4e3ff954f4919d6506ad2e1 (diff) | |
download | tor-2d92f4c19a151157b81091d352d59e4f72810542.tar.gz tor-2d92f4c19a151157b81091d352d59e4f72810542.zip |
Don't keep options in a local in run_main_loop_once.
The options value can change between the get_options() and its
second use, based on setconf callbacks in the event loop.
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/or/main.c b/src/or/main.c index 9e51e35bcb..f0489b3b3a 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -2750,8 +2750,6 @@ run_main_loop_once(void) if (main_loop_should_exit) return 0; - const or_options_t *options = get_options(); - #ifndef _WIN32 /* Make it easier to tell whether libevent failure is our fault or not. */ errno = 0; @@ -2762,7 +2760,7 @@ run_main_loop_once(void) SMARTLIST_FOREACH(active_linked_connection_lst, connection_t *, conn, event_active(conn->read_event, EV_READ, 1)); - if (options->MainloopStats) { + if (get_options()->MainloopStats) { /* We always enforce that EVLOOP_ONCE is passed to event_base_loop() if we * are collecting main loop statistics. */ called_loop_once = 1; @@ -2780,7 +2778,7 @@ run_main_loop_once(void) loop_result = event_base_loop(tor_libevent_get_base(), called_loop_once ? EVLOOP_ONCE : 0); - if (options->MainloopStats) { + if (get_options()->MainloopStats) { /* Update our main loop counters. */ if (loop_result == 0) { // The call was succesful. |