diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-10-14 13:33:36 -0400 |
---|---|---|
committer | Andrea Shepard <andrea@torproject.org> | 2014-09-30 22:48:26 -0700 |
commit | 472b62bfe4edb2f5e332c997be2ec69bdf590660 (patch) | |
tree | 4bef53d6d49e428edfdbdf2c7699a062feb48c5f /src/or/config.c | |
parent | 85ee5b3095f60052412a0bbb1ef0a4ccd5b7c97e (diff) | |
download | tor-472b62bfe4edb2f5e332c997be2ec69bdf590660.tar.gz tor-472b62bfe4edb2f5e332c997be2ec69bdf590660.zip |
Uglify scheduler init logic to avoid crash on startup.
Otherwise, when we authority try to do a self-test because of
init-keys, if that self-test can't be launched for whatever reason and
so we close the channel immediately, we crash.
Yes, this a silly way for initialization to work.
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c index 16acec791c..4ae9fadfeb 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -43,6 +43,7 @@ #include "util.h" #include "routerlist.h" #include "routerset.h" +#include "scheduler.h" #include "statefile.h" #include "transports.h" #include "ext_orport.h" @@ -1040,6 +1041,14 @@ options_act_reversible(const or_options_t *old_options, char **msg) if (running_tor && !libevent_initialized) { init_libevent(options); libevent_initialized = 1; + + /* + * Initialize the scheduler - this has to come after + * options_init_from_torrc() sets up libevent - why yes, that seems + * completely sensible to hide the libevent setup in the option parsing + * code! It also needs to happen before init_keys(), so it needs to + * happen here too. How yucky. */ + scheduler_init(); } /* Adjust the port configuration so we can launch listeners. */ |