aboutsummaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-12-17 14:59:19 +0000
committerNick Mathewson <nickm@torproject.org>2008-12-17 14:59:19 +0000
commit26632d59dd34aef4834ee9844adeab5131248bf7 (patch)
tree694c0654f8ae8194c1f2b5ce490990aa5f101821 /src/or/main.c
parent514f99034fffcbfe6cd37d2b982c6c637e62f37e (diff)
downloadtor-26632d59dd34aef4834ee9844adeab5131248bf7.tar
tor-26632d59dd34aef4834ee9844adeab5131248bf7.tar.gz
Rename or_is_obsolete and move it to or_connection_t where it belongs.
svn:r17642
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/or/main.c b/src/or/main.c
index a6411d5b0..b2074e210 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -99,8 +99,8 @@ int has_completed_circuit=0;
#define DIR_CONN_MAX_STALL (5*60)
/** How old do we let a connection to an OR get before deciding it's
- * obsolete? */
-#define TIME_BEFORE_OR_CONN_IS_OBSOLETE (60*60*24*7)
+ * too old for new circuits? */
+#define TIME_BEFORE_OR_CONN_IS_TOO_OLD (60*60*24*7)
/** How long do we let OR connections handshake before we decide that
* they are obsolete? */
#define TLS_HANDSHAKE_TIMEOUT (60)
@@ -714,13 +714,14 @@ run_connection_housekeeping(int i, time_t now)
or_conn = TO_OR_CONN(conn);
- if (!conn->or_is_obsolete) {
- if (conn->timestamp_created + TIME_BEFORE_OR_CONN_IS_OBSOLETE < now) {
+ if (!or_conn->is_bad_for_new_circs) {
+ if (conn->timestamp_created + TIME_BEFORE_OR_CONN_IS_TOO_OLD < now) {
log_info(LD_OR,
- "Marking OR conn to %s:%d obsolete (fd %d, %d secs old).",
+ "Marking OR conn to %s:%d as too old for new circuits "
+ "(fd %d, %d secs old).",
conn->address, conn->port, conn->s,
(int)(now - conn->timestamp_created));
- conn->or_is_obsolete = 1;
+ or_conn->is_bad_for_new_circs = 1;
} else {
or_connection_t *best =
connection_or_get_by_identity_digest(or_conn->identity_digest);
@@ -735,19 +736,19 @@ run_connection_housekeeping(int i, time_t now)
* early for router->last_reachable to be updated.
*/
log_info(LD_OR,
- "Marking duplicate conn to %s:%d obsolete "
+ "Marking duplicate conn to %s:%d as too old for new circuits "
"(fd %d, %d secs old).",
conn->address, conn->port, conn->s,
(int)(now - conn->timestamp_created));
- conn->or_is_obsolete = 1;
+ or_conn->is_bad_for_new_circs = 1;
}
}
}
- if (conn->or_is_obsolete && !or_conn->n_circuits) {
+ if (or_conn->is_bad_for_new_circs && !or_conn->n_circuits) {
/* no unmarked circs -- mark it now */
log_info(LD_OR,
- "Expiring non-used OR connection to fd %d (%s:%d) [Obsolete].",
+ "Expiring non-used OR connection to fd %d (%s:%d) [Too old].",
conn->s, conn->address, conn->port);
if (conn->state == OR_CONN_STATE_CONNECTING)
connection_or_connect_failed(TO_OR_CONN(conn),
@@ -905,7 +906,7 @@ run_scheduled_events(time_t now)
}
last_rotated_x509_certificate = now;
/* We also make sure to rotate the TLS connections themselves if they've
- * been up for too long -- but that's done via or_is_obsolete in
+ * been up for too long -- but that's done via is_bad_for_new_circs in
* connection_run_housekeeping() above. */
}