diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-11-06 07:42:55 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-11-06 07:42:55 -0500 |
commit | 9431d3507490cc85a32969f7eb81808b08966677 (patch) | |
tree | 686786d56e453f5ccd5baa5f18a02ba4e09ad52e /src/core/mainloop | |
parent | 996f24fcd31be197b8cfc9cb5dddd2b04a4cf3a2 (diff) | |
parent | 2aff02eb3dee506424874bd6d9c1ded3860abc22 (diff) | |
download | tor-9431d3507490cc85a32969f7eb81808b08966677.tar.gz tor-9431d3507490cc85a32969f7eb81808b08966677.zip |
Merge branch 'bug28348_034' into bug28348_035
Diffstat (limited to 'src/core/mainloop')
-rw-r--r-- | src/core/mainloop/mainloop.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/mainloop/mainloop.c b/src/core/mainloop/mainloop.c index a24b343756..a9f1429787 100644 --- a/src/core/mainloop/mainloop.c +++ b/src/core/mainloop/mainloop.c @@ -1598,15 +1598,17 @@ rescan_periodic_events(const or_options_t *options) for (int i = 0; periodic_events[i].name; ++i) { periodic_event_item_t *item = &periodic_events[i]; + int enable = !!(item->roles & roles); + /* Handle the event flags. */ if (net_is_disabled() && (item->flags & PERIODIC_EVENT_FLAG_NEED_NET)) { - continue; + enable = 0; } /* Enable the event if needed. It is safe to enable an event that was * already enabled. Same goes for disabling it. */ - if (item->roles & roles) { + if (enable) { log_debug(LD_GENERAL, "Launching periodic event %s", item->name); periodic_event_enable(item); } else { |