aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-07-20 19:28:02 +0000
committerRoger Dingledine <arma@torproject.org>2004-07-20 19:28:02 +0000
commit66fc6cf04a006904605ffdeda13140acf237ff8c (patch)
treed12b7ab432a030ba5d6c3359d1ff4051017874d2
parentdc7951a5a77b8fcd128ad7890ebc0fec54d49a43 (diff)
downloadtor-66fc6cf04a006904605ffdeda13140acf237ff8c.tar
tor-66fc6cf04a006904605ffdeda13140acf237ff8c.tar.gz
if you're an OR and he's an OR and he's running 0.0.7,
don't expire your connections to him. svn:r2062
-rw-r--r--src/or/main.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 04482dbdd..e657310d0 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -370,10 +370,14 @@ static void run_connection_housekeeping(int i, time_t now) {
the connection or send a keepalive, depending. */
if(connection_speaks_cells(conn) &&
now >= conn->timestamp_lastwritten + options.KeepalivePeriod) {
- if((!clique_mode() && !circuit_get_by_conn(conn)) ||
- (!connection_state_is_open(conn))) {
- /* we're an onion proxy, with no circuits;
- * or our handshake has expired. kill it. */
+ 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)))) {
+ /* 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,
+ * then kill it. */
log_fn(LOG_INFO,"Expiring connection to %d (%s:%d).",
i,conn->address, conn->port);
/* flush anything waiting, e.g. a destroy for a just-expired circ */