[or-cvs] Do not mark connections obsolete before they have done thei...

Peter Palfrader weasel at seul.org
Tue Feb 14 04:23:07 UTC 2006


Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv3527

Modified Files:
	main.c 
Log Message:
Do not mark connections obsolete before they have done their TLS handshake or are at least 60 seconds old

Index: main.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.623
retrieving revision 1.624
diff -u -p -d -r1.623 -r1.624
--- main.c	13 Feb 2006 09:37:53 -0000	1.623
+++ main.c	14 Feb 2006 04:23:05 -0000	1.624
@@ -623,6 +623,7 @@ run_connection_housekeeping(int i, time_
     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_
     } 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).",



More information about the tor-commits mailing list