aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-07-20 19:45:29 +0000
committerRoger Dingledine <arma@torproject.org>2004-07-20 19:45:29 +0000
commitd5999a24af8076147e661328d4948b6522f0051d (patch)
tree572a91e5da5aab0a03c854ade7fed8a394dea799 /src
parent66fc6cf04a006904605ffdeda13140acf237ff8c (diff)
downloadtor-d5999a24af8076147e661328d4948b6522f0051d.tar
tor-d5999a24af8076147e661328d4948b6522f0051d.tar.gz
also don't hang up on him if we're an OR and he's an authdirserver
otherwise we keep getting taken out of the running-routers list svn:r2063
Diffstat (limited to 'src')
-rw-r--r--src/or/main.c5
-rw-r--r--src/or/or.h1
-rw-r--r--src/or/router.c8
3 files changed, 12 insertions, 2 deletions
diff --git a/src/or/main.c b/src/or/main.c
index e657310d0..1050716c3 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -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);
diff --git a/src/or/or.h b/src/or/or.h
index 923e8184d..f6e84242b 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -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);
diff --git a/src/or/router.c b/src/or/router.c
index 2f2769ca3..1ff60d2d0 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -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.
*/