[or-cvs] call directory_has_arrived has arrived every time we get

Roger Dingledine arma at seul.org
Fri Apr 9 19:30:40 UTC 2004


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

Modified Files:
	directory.c main.c 
Log Message:
call directory_has_arrived has arrived every time we get
a new directory, not just the first time


Index: directory.c
===================================================================
RCS file: /home/or/cvsroot/src/or/directory.c,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -d -r1.88 -r1.89
--- directory.c	8 Apr 2004 03:53:39 -0000	1.88
+++ directory.c	9 Apr 2004 19:30:38 -0000	1.89
@@ -11,7 +11,6 @@
 /********* START VARIABLES **********/
 
 extern or_options_t options; /* command-line and config-file options */
-extern int has_fetched_directory;
 
 char rend_publish_string[] = "/rendezvous/publish";
 char rend_fetch_url[] = "/rendezvous/";
@@ -243,13 +242,7 @@
       } else {
         log_fn(LOG_INFO,"updated routers.");
       }
-      if(options.ORPort) { /* connect to them all */
-        router_retry_connections();
-      }
-      if (has_fetched_directory==0) {
-        has_fetched_directory=1;
-        directory_has_arrived(); /* do things we've been waiting to do */
-      }
+      directory_has_arrived(); /* do things we've been waiting to do */
     }
 
     if(conn->purpose == DIR_PURPOSE_UPLOAD_DIR) {

Index: main.c
===================================================================
RCS file: /home/or/cvsroot/src/or/main.c,v
retrieving revision 1.231
retrieving revision 1.232
diff -u -d -r1.231 -r1.232
--- main.c	9 Apr 2004 17:54:20 -0000	1.231
+++ main.c	9 Apr 2004 19:30:38 -0000	1.232
@@ -282,14 +282,22 @@
   }
 }
 
+/* This function is called whenever we successfully pull
+ * down a directory */
 void directory_has_arrived(void) {
 
-  log_fn(LOG_INFO, "We now have a directory.");
+  log_fn(LOG_INFO, "A directory has arrived.");
 
   /* just for testing */
 //  directory_initiate_command(router_pick_directory_server(),
 //                             DIR_PURPOSE_FETCH_RENDDESC, "foo", 3);
 
+  has_fetched_directory=1;
+
+  if(options.ORPort) { /* connect to them all */
+    router_retry_connections();
+  }
+
   rend_services_init(); /* get bob to initialize all his hidden services */
 
 }



More information about the tor-commits mailing list