mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 20:33:31 +01:00
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.
This commit is contained in:
parent
85ee5b3095
commit
472b62bfe4
@ -43,6 +43,7 @@
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "routerlist.h"
|
#include "routerlist.h"
|
||||||
#include "routerset.h"
|
#include "routerset.h"
|
||||||
|
#include "scheduler.h"
|
||||||
#include "statefile.h"
|
#include "statefile.h"
|
||||||
#include "transports.h"
|
#include "transports.h"
|
||||||
#include "ext_orport.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) {
|
if (running_tor && !libevent_initialized) {
|
||||||
init_libevent(options);
|
init_libevent(options);
|
||||||
libevent_initialized = 1;
|
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. */
|
/* Adjust the port configuration so we can launch listeners. */
|
||||||
|
@ -2456,14 +2456,6 @@ tor_init(int argc, char *argv[])
|
|||||||
log_warn(LD_NET, "Problem initializing libevent RNG.");
|
log_warn(LD_NET, "Problem initializing libevent RNG.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* 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!
|
|
||||||
*/
|
|
||||||
scheduler_init();
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user