aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2006-02-14 04:23:05 +0000
committerPeter Palfrader <peter@palfrader.org>2006-02-14 04:23:05 +0000
commit84295f9f438241e2e7391acd71c7283ab5e3a473 (patch)
tree60ab81dd0fe17893bad99388125a0a06fbe477f1
parent761da5b97feb333f3f0d6f6565256644f92a0ae3 (diff)
downloadtor-84295f9f438241e2e7391acd71c7283ab5e3a473.tar
tor-84295f9f438241e2e7391acd71c7283ab5e3a473.tar.gz
Do not mark connections obsolete before they have done their TLS handshake or are at least 60 seconds old
svn:r6013
-rw-r--r--src/or/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/main.c b/src/or/main.c
index d4e33cc71..66f70396b 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -623,6 +623,7 @@ run_connection_housekeeping(int i, time_t now)
return; /* we're all done here, the rest is just for OR conns */
#define TIME_BEFORE_OR_CONN_IS_OBSOLETE (60*60*24*7) /* a week */
+#define TLS_TIMEOUT (60) /* a minute */
if (!conn->is_obsolete) {
if (conn->timestamp_created + TIME_BEFORE_OR_CONN_IS_OBSOLETE < now) {
log_info(LD_OR,
@@ -633,7 +634,9 @@ run_connection_housekeeping(int i, time_t now)
} else {
connection_t *best =
connection_or_get_by_identity_digest(conn->identity_digest);
- if (best && best != conn) {
+ if (best && best != conn &&
+ (conn->state == OR_CONN_STATE_OPEN ||
+ now > conn->timestamp_created + TLS_TIMEOUT)) {
log_info(LD_OR,
"Marking duplicate conn to %s:%d obsolete "
"(fd %d, %d secs old).",