aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2005-12-04 21:51:50 +0000
committerRoger Dingledine <arma@torproject.org>2005-12-04 21:51:50 +0000
commitd60f514f4c6e463fe188eefcbbcdfe9b4f127e99 (patch)
tree9cbd35d289209de58753da67e3aa2daa8484e075
parent1b0134dda8d877f8917f86cf8d3b42fa41ffb625 (diff)
downloadtor-d60f514f4c6e463fe188eefcbbcdfe9b4f127e99.tar
tor-d60f514f4c6e463fe188eefcbbcdfe9b4f127e99.tar.gz
fix the first bug with our optimization to circuit_expire_building():
we were killing off rendezvous circuits unless they magically time-warped to be too old before we got around to killing them, in which case we would leave them alone. this made it hard to rendezvous with hidden services. svn:r5494
-rw-r--r--src/or/circuituse.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index c1a745e92..5ff39ad2f 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -219,7 +219,6 @@ circuit_expire_building(time_t now)
}
#endif
-
/* if circ is !open, or if it's open but purpose is a non-finished
* intro or rend, then mark it for close */
if (victim->state == CIRCUIT_STATE_OPEN) {
@@ -232,20 +231,21 @@ circuit_expire_building(time_t now)
* IS_ORIGIN test above. */
continue; /* yes, continue inside a switch refers to the nearest
* enclosing loop. C is smart. */
+
case CIRCUIT_PURPOSE_C_ESTABLISH_REND:
case CIRCUIT_PURPOSE_C_INTRODUCING:
case CIRCUIT_PURPOSE_S_ESTABLISH_INTRO:
break;
case CIRCUIT_PURPOSE_C_REND_READY:
/* it's a rend_ready circ -- has it already picked a query? */
- if (!victim->rend_query[0] && victim->timestamp_dirty > cutoff)
+ /* c_rend_ready circs measure age since timestamp_dirty,
+ * because that's set when they switch purposes
+ */
+ if (!victim->rend_query[0] || victim->timestamp_dirty <= cutoff)
continue;
break;
case CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED:
case CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT:
- /* c_rend_ready circs measure age since timestamp_dirty,
- * because that's set when they switch purposes
- */
/* rend and intro circs become dirty each time they
* make an introduction attempt. so timestamp_dirty
* will reflect the time since the last attempt.
@@ -1027,7 +1027,7 @@ link_apconn_to_circ(connection_t *apconn, circuit_t *circ)
}
/** If an exit wasn't specifically chosen, save the history for future
- * use */
+ * use. */
static void
consider_recording_trackhost(connection_t *conn, circuit_t *circ)
{
@@ -1066,6 +1066,7 @@ consider_recording_trackhost(connection_t *conn, circuit_t *circ)
strlen("exit") + 1 /* '\0' */;
new_address = tor_malloc(len);
+ //XXX need to use $key not nickname
tor_snprintf(new_address, len, "%s.%s.exit",
conn->socks_request->address,
circ->build_state->chosen_exit->nickname);