diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-04-26 13:15:38 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-04-26 13:15:38 -0400 |
commit | 96c5ac338a7df986d2419e14801df42421debd06 (patch) | |
tree | a67d203e3629a26d29af8afce5d014f5952b357c /src/or/channel.c | |
parent | 7b09282dc723381e68fef79c3474a56315a0edfa (diff) | |
download | tor-96c5ac338a7df986d2419e14801df42421debd06.tar.gz tor-96c5ac338a7df986d2419e14801df42421debd06.zip |
Move close-and-cleanup functions to a postloop event.
Implements ticket 25932.
Diffstat (limited to 'src/or/channel.c')
-rw-r--r-- | src/or/channel.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/channel.c b/src/or/channel.c index 68245db497..c30e508018 100644 --- a/src/or/channel.c +++ b/src/or/channel.c @@ -69,6 +69,7 @@ #include "circuitmux.h" #include "entrynodes.h" #include "geoip.h" +#include "main.h" #include "nodelist.h" #include "relay.h" #include "rephist.h" @@ -404,6 +405,7 @@ channel_register(channel_t *chan) /* Put it in the finished list, creating it if necessary */ if (!finished_channels) finished_channels = smartlist_new(); smartlist_add(finished_channels, chan); + mainloop_schedule_postloop_cleanup(); } else { /* Put it in the active list, creating it if necessary */ if (!active_channels) active_channels = smartlist_new(); @@ -1548,6 +1550,7 @@ channel_change_state_(channel_t *chan, channel_state_t to_state) if (active_channels) smartlist_remove(active_channels, chan); if (!finished_channels) finished_channels = smartlist_new(); smartlist_add(finished_channels, chan); + mainloop_schedule_postloop_cleanup(); } /* Need to put on active list? */ else if (!was_active && is_active) { @@ -1666,6 +1669,7 @@ channel_listener_change_state(channel_listener_t *chan_l, if (active_listeners) smartlist_remove(active_listeners, chan_l); if (!finished_listeners) finished_listeners = smartlist_new(); smartlist_add(finished_listeners, chan_l); + mainloop_schedule_postloop_cleanup(); } /* Need to put on active list? */ else if (!was_active && is_active) { |