diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-11-06 09:16:25 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-11-06 09:16:25 -0500 |
commit | 313b5b956c487dcdee21206c34c608835f699a73 (patch) | |
tree | 7518fe4b240433698ab35aca07e4ee060e71caee | |
parent | 674ef53a7e953a724b4f3bfe2f1e06ba2897bba2 (diff) | |
parent | 9431d3507490cc85a32969f7eb81808b08966677 (diff) | |
download | tor-313b5b956c487dcdee21206c34c608835f699a73.tar.gz tor-313b5b956c487dcdee21206c34c608835f699a73.zip |
Merge branch 'maint-0.3.5'
-rw-r--r-- | changes/bug28348_034 | 5 | ||||
-rw-r--r-- | src/core/mainloop/mainloop.c | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/changes/bug28348_034 b/changes/bug28348_034 new file mode 100644 index 0000000000..3913c03a4c --- /dev/null +++ b/changes/bug28348_034 @@ -0,0 +1,5 @@ + o Major bugfixes (embedding, main loop): + - When DisableNetwork becomes set, actually disable periodic events that + are already enabled. (Previously, we would refrain from enabling new + ones, but we would leave the old ones turned on.) + Fixes bug 28348; bugfix on 0.3.4.1-alpha. 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 { |