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

[or-cvs] refuse to build a circuit before the directory has arrived



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

Modified Files:
	circuitbuild.c circuituse.c 
Log Message:
refuse to build a circuit before the directory has arrived
this will prevent a few of the 'couldn't decrypt onionskin' errors, maybe


Index: circuitbuild.c
===================================================================
RCS file: /home/or/cvsroot/src/or/circuitbuild.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- circuitbuild.c	12 Jul 2004 23:53:16 -0000	1.9
+++ circuitbuild.c	13 Jul 2004 01:25:39 -0000	1.10
@@ -726,8 +726,6 @@
   return 0;
 }
 
-extern int has_fetched_directory; /* from main.c */
-
 /** Choose a length for a circuit of purpose <b>purpose</b>.
  * Default length is 3 + the number of endpoints that would give something
  * away. If the routerlist <b>routers</b> doesn't have enough routers

Index: circuituse.c
===================================================================
RCS file: /home/or/cvsroot/src/or/circuituse.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- circuituse.c	2 Jul 2004 23:40:03 -0000	1.5
+++ circuituse.c	13 Jul 2004 01:25:39 -0000	1.6
@@ -14,6 +14,7 @@
 /********* START VARIABLES **********/
 
 extern circuit_t *global_circuitlist; /* from circuitlist.c */
+extern int has_fetched_directory; /* from main.c */
 
 /********* END VARIABLES ************/
 
@@ -590,6 +591,11 @@
 
 circuit_t *circuit_launch_by_identity(uint8_t purpose, const char *exit_digest)
 {
+  if (!has_fetched_directory) {
+    log_fn(LOG_DEBUG,"Haven't fetched directory yet; cancelling circuit launch.");
+    return NULL;
+  }
+
   if (n_circuit_failures > MAX_CIRCUIT_FAILURES) {
     /* too many failed circs in a row. don't try. */
 //    log_fn(LOG_INFO,"%d failures so far, not trying.",n_circuit_failures);