Kaynağa Gözat

Resolve FIXME items: make the kill-unattached-AP timeout symbolic

svn:r2793
Nick Mathewson 20 yıl önce
ebeveyn
işleme
a43db78e8d
1 değiştirilmiş dosya ile 4 ekleme ve 2 silme
  1. 4 2
      src/or/circuituse.c

+ 4 - 2
src/or/circuituse.c

@@ -11,6 +11,9 @@
 
 
 #include "or.h"
 #include "or.h"
 
 
+/** Longest time to wait for a circuit before closing an AP connection */
+#define CONN_AP_MAX_ATTACH_DELAY 60
+
 /********* START VARIABLES **********/
 /********* START VARIABLES **********/
 
 
 extern circuit_t *global_circuitlist; /* from circuitlist.c */
 extern circuit_t *global_circuitlist; /* from circuitlist.c */
@@ -764,8 +767,7 @@ int connection_ap_handshake_attach_circuit(connection_t *conn) {
   tor_assert(conn->socks_request);
   tor_assert(conn->socks_request);
 
 
   conn_age = time(NULL) - conn->timestamp_created;
   conn_age = time(NULL) - conn->timestamp_created;
-  if(conn_age > 60) {
+  if(conn_age > CONN_AP_MAX_ATTACH_DELAY) {
-    /* XXX make this cleaner than '60' */
     log_fn(LOG_WARN,"Giving up on unattached conn (%d sec old).", conn_age);
     log_fn(LOG_WARN,"Giving up on unattached conn (%d sec old).", conn_age);
     return -1;
     return -1;
   }
   }