summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-11-23 09:00:55 +0000
committerRoger Dingledine <arma@torproject.org>2004-11-23 09:00:55 +0000
commit57a392d8d8676ee4909c7662129cfcd1e7430ff2 (patch)
treeb7b953a6a23962730087838468083dfa72dd1ae0
parentd7fb38cfe3615681e6480932ae54ca9062a90b74 (diff)
downloadtor-57a392d8d8676ee4909c7662129cfcd1e7430ff2.tar.gz
tor-57a392d8d8676ee4909c7662129cfcd1e7430ff2.zip
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
-rw-r--r--src/or/main.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 7dfbf7f3a9..db3a35b344 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -786,11 +786,6 @@ static int do_main_loop(void) {
int timeout;
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
* TLS context. */
if (! identity_key_is_set()) {
@@ -1062,6 +1057,12 @@ void handle_signals(int is_parent)
*/
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 */
add_temp_log();
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 */
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);