aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-04-07 19:14:33 +0000
committerRoger Dingledine <arma@torproject.org>2004-04-07 19:14:33 +0000
commitcf67520e954993ebf2f144fa025cc9f0861b5f13 (patch)
tree613f2f2636f5fee44041a973ef233a27129ef093 /src/or
parentff76072feb5d2b40ded6ea37d0cdda5ec718a3e2 (diff)
downloadtor-cf67520e954993ebf2f144fa025cc9f0861b5f13.tar.gz
tor-cf67520e954993ebf2f144fa025cc9f0861b5f13.zip
when counting how many being-built circs will handle a stream,
don't count ones that are too old svn:r1517
Diffstat (limited to 'src/or')
-rw-r--r--src/or/circuit.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/circuit.c b/src/or/circuit.c
index 78ef57d636..a4794dc113 100644
--- a/src/or/circuit.c
+++ b/src/or/circuit.c
@@ -459,10 +459,13 @@ int circuit_stream_is_being_handled(connection_t *conn) {
circuit_t *circ;
routerinfo_t *exitrouter;
int num=0;
+ time_t now = time(NULL);
for(circ=global_circuitlist;circ;circ = circ->next) {
if(circ->cpath && circ->state != CIRCUIT_STATE_OPEN &&
- !circ->marked_for_close && circ->purpose == CIRCUIT_PURPOSE_C_GENERAL) {
+ !circ->marked_for_close && circ->purpose == CIRCUIT_PURPOSE_C_GENERAL &&
+ (!circ->timestamp_dirty ||
+ circ->timestamp_dirty + options.NewCircuitPeriod < now)) {
exitrouter = router_get_by_nickname(circ->build_state->chosen_exit);
if(exitrouter && connection_ap_can_use_exit(conn, exitrouter) != ADDR_POLICY_REJECTED)
if(++num >= MIN_CIRCUITS_HANDLING_STREAM)