[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] initialize rephist before we init_from_config, since init_f...



Update of /home2/or/cvsroot/tor/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/tor/src/or

Modified Files:
	main.c 
Log Message:
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.


Index: main.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.385
retrieving revision 1.386
diff -u -d -r1.385 -r1.386
--- main.c	22 Nov 2004 22:10:37 -0000	1.385
+++ main.c	23 Nov 2004 09:00:55 -0000	1.386
@@ -786,11 +786,6 @@
   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 @@
  */
 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 @@
   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);