mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-01 08:03:31 +01:00
Merge branch 'bug28348_035' into bug28348_036
This commit is contained in:
commit
c32dab9e48
5
changes/bug28348_034
Normal file
5
changes/bug28348_034
Normal file
@ -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.
|
@ -1598,15 +1598,17 @@ rescan_periodic_events(const or_options_t *options)
|
|||||||
for (int i = 0; periodic_events[i].name; ++i) {
|
for (int i = 0; periodic_events[i].name; ++i) {
|
||||||
periodic_event_item_t *item = &periodic_events[i];
|
periodic_event_item_t *item = &periodic_events[i];
|
||||||
|
|
||||||
|
int enable = !!(item->roles & roles);
|
||||||
|
|
||||||
/* Handle the event flags. */
|
/* Handle the event flags. */
|
||||||
if (net_is_disabled() &&
|
if (net_is_disabled() &&
|
||||||
(item->flags & PERIODIC_EVENT_FLAG_NEED_NET)) {
|
(item->flags & PERIODIC_EVENT_FLAG_NEED_NET)) {
|
||||||
continue;
|
enable = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Enable the event if needed. It is safe to enable an event that was
|
/* Enable the event if needed. It is safe to enable an event that was
|
||||||
* already enabled. Same goes for disabling it. */
|
* already enabled. Same goes for disabling it. */
|
||||||
if (item->roles & roles) {
|
if (enable) {
|
||||||
log_debug(LD_GENERAL, "Launching periodic event %s", item->name);
|
log_debug(LD_GENERAL, "Launching periodic event %s", item->name);
|
||||||
periodic_event_enable(item);
|
periodic_event_enable(item);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user