]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
also don't hang up on him if we're an OR and he's an authdirserver
authorRoger Dingledine <arma@torproject.org>
Tue, 20 Jul 2004 19:45:29 +0000 (19:45 +0000)
committerRoger Dingledine <arma@torproject.org>
Tue, 20 Jul 2004 19:45:29 +0000 (19:45 +0000)
otherwise we keep getting taken out of the running-routers list

svn:r2063

src/or/main.c
src/or/or.h
src/or/router.c

index e657310d0ced324ac7d4827b655360d283636610..1050716c35c761758e8dd04fe43656283b5f47f9 100644 (file)
@@ -373,10 +373,11 @@ static void run_connection_housekeeping(int i, time_t now) {
     routerinfo_t *router = router_get_by_digest(conn->identity_digest);
     if((!connection_state_is_open(conn)) ||
        (!clique_mode() && !circuit_get_by_conn(conn) &&
-       (!router || !server_mode() || strncmp(router->platform, "Tor 0.0.7", 9)))) {
+       (!router || !server_mode() || !router_is_clique_mode(router)))) {
       /* our handshake has expired;
        * or we're not an authdirserver, we have no circuits, and
-       *   either he's an OP, we're an OP, or we're both ORs and he's running 0.0.8,
+       *   either he's an OP, we're an OP, or we're both ORs and he's
+       *   running 0.0.8 and he's not an authdirserver,
        * then kill it. */
       log_fn(LOG_INFO,"Expiring connection to %d (%s:%d).",
              i,conn->address, conn->port);
index 923e8184d671ed047163723161b8859b1c46278a..f6e84242b3c881098fa596bd13a6507ec739a6cc 100644 (file)
@@ -1345,6 +1345,7 @@ crypto_pk_env_t *init_key_from_file(const char *fname);
 void rotate_onion_key(void);
 
 void router_retry_connections(void);
+int router_is_clique_mode(routerinfo_t *router);
 void router_upload_dir_desc_to_dirservers(void);
 int router_compare_to_my_exit_policy(connection_t *conn);
 routerinfo_t *router_get_my_routerinfo(void);
index 2f2769ca3dfac10728a0d94ed5a1807f2633b1c3..1ff60d2d0ec52747874a09711133e41d64c6dbdd 100644 (file)
@@ -368,6 +368,14 @@ void router_retry_connections(void) {
   }
 }
 
+int router_is_clique_mode(routerinfo_t *router) {
+  if(router->is_trusted_dir)
+    return 1;
+  if(!strncmp(router->platform, "Tor 0.0.7", 9))
+    return 1;
+  return 0;
+}
+
 /*
  * OR descriptor generation.
  */