initialize rephist before we init_from_config, since init_from_config

can make us init_keys if we're going to hibernate, which makes us build
a router_desc.


svn:r2953
This commit is contained in:
Roger Dingledine 2004-11-23 09:00:55 +00:00
parent d7fb38cfe3
commit 57a392d8d8

View File

@ -786,11 +786,6 @@ static int do_main_loop(void) {
int timeout; int timeout;
int poll_result; int poll_result;
/* Initialize the history structures. */
rep_hist_init();
/* Intialize the service cache. */
rend_cache_init();
/* load the private keys, if we're supposed to have them, and set up the /* load the private keys, if we're supposed to have them, and set up the
* TLS context. */ * TLS context. */
if (! identity_key_is_set()) { if (! identity_key_is_set()) {
@ -1062,6 +1057,12 @@ void handle_signals(int is_parent)
*/ */
static int tor_init(int argc, char *argv[]) { static int tor_init(int argc, char *argv[]) {
/* Initialize the history structures. */
rep_hist_init();
/* Initialize the service cache. */
rend_cache_init();
client_dns_init(); /* Init the client dns cache. Do it always, since it's cheap. */
/* give it somewhere to log to initially */ /* give it somewhere to log to initially */
add_temp_log(); add_temp_log();
log_fn(LOG_NOTICE,"Tor v%s. This is experimental software. Do not rely on it for strong anonymity.",VERSION); log_fn(LOG_NOTICE,"Tor v%s. This is experimental software. Do not rely on it for strong anonymity.",VERSION);
@ -1085,7 +1086,6 @@ static int tor_init(int argc, char *argv[]) {
if(server_mode(get_options())) { /* only spawn dns handlers if we're a router */ if(server_mode(get_options())) { /* only spawn dns handlers if we're a router */
dns_init(); /* initialize the dns resolve tree, and spawn workers */ dns_init(); /* initialize the dns resolve tree, and spawn workers */
} }
client_dns_init(); /* Init the client dns cache. Do it always, since it's cheap. */
handle_signals(1); handle_signals(1);