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

[or-cvs] 0.0.8 ORs should autoconnect to authdirservers and 0.0.7 se...



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

Modified Files:
	main.c router.c 
Log Message:
0.0.8 ORs should autoconnect to authdirservers and 0.0.7 servers


Index: main.c
===================================================================
RCS file: /home/or/cvsroot/src/or/main.c,v
retrieving revision 1.302
retrieving revision 1.303
diff -u -d -r1.302 -r1.303
--- main.c	21 Jul 2004 18:53:56 -0000	1.302
+++ main.c	21 Jul 2004 23:43:47 -0000	1.303
@@ -353,7 +353,7 @@
 
   has_fetched_directory=1;
 
-  if(clique_mode()) { /* connect to them all */
+  if(server_mode()) { /* connect to the appropriate routers */
     router_retry_connections();
   }
 }
@@ -541,7 +541,10 @@
     if(authdir_mode()) {
       /* We're a directory; dump any old descriptors. */
       dirserv_remove_old_servers();
-      /* dirservers try to reconnect, in case connections have failed */
+    }
+    if(server_mode()) {
+      /* dirservers try to reconnect, in case connections have failed;
+       * and normal servers try to reconnect to dirservers */
       router_retry_connections();
     }
 

Index: router.c
===================================================================
RCS file: /home/or/cvsroot/src/or/router.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- router.c	21 Jul 2004 18:53:56 -0000	1.71
+++ router.c	21 Jul 2004 23:43:47 -0000	1.72
@@ -347,18 +347,24 @@
  * Clique maintenance
  */
 
-/** OR only: try to open connections to all of the other ORs we know about.
+/** OR only: if in clique mode, try to open connections to all of the
+ * other ORs we know about. Otherwise, open connections to those we
+ * think are in clique mode.
  */
 void router_retry_connections(void) {
   int i;
   routerinfo_t *router;
   routerlist_t *rl;
 
+  tor_assert(server_mode());
+
   router_get_routerlist(&rl);
   for (i=0;i < smartlist_len(rl->routers);i++) {
     router = smartlist_get(rl->routers, i);
     if(router_is_me(router))
       continue;
+    if(!clique_mode() && !router_is_clique_mode(router))
+      continue;
     if(!connection_get_by_identity_digest(router->identity_digest,
                                           CONN_TYPE_OR)) {
       /* not in the list */