diff options
author | Roger Dingledine <arma@torproject.org> | 2003-12-13 07:42:18 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2003-12-13 07:42:18 +0000 |
commit | 7a3a3ae1dfebdfac115c83589f211de51e80c58d (patch) | |
tree | f0c3dd2543090bc9e7983d94d187c37ebd8fd9f8 /src/or/circuit.c | |
parent | 9e6f4a30296815aab99393218c75b44d1aca25e4 (diff) | |
download | tor-7a3a3ae1dfebdfac115c83589f211de51e80c58d.tar.gz tor-7a3a3ae1dfebdfac115c83589f211de51e80c58d.zip |
bugfix: a circuit that immediately failed still counts as a failed circuit
svn:r905
Diffstat (limited to 'src/or/circuit.c')
-rw-r--r-- | src/or/circuit.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/circuit.c b/src/or/circuit.c index 09f20580d5..540a624a5f 100644 --- a/src/or/circuit.c +++ b/src/or/circuit.c @@ -584,7 +584,8 @@ void circuit_close(circuit_t *circ) { for(conn=circ->p_streams; conn; conn=conn->next_stream) { connection_send_destroy(circ->p_circ_id, conn); } - if (circ->state != CIRCUIT_STATE_OPEN && circ->cpath) { + if (circ->state == CIRCUIT_STATE_BUILDING || + circ->state == CIRCUIT_STATE_OR_WAIT) { /* If we never built the circuit, note it as a failure. */ circuit_increment_failure_count(); } @@ -719,8 +720,10 @@ int circuit_launch_new(void) { if(!options.SocksPort) /* we're not an application proxy. no need for circuits. */ return -1; - if(n_circuit_failures > 5) /* too many failed circs in a row. don't try. */ + if(n_circuit_failures > 5) { /* too many failed circs in a row. don't try. */ +// log_fn(LOG_INFO,"%d failures so far, not trying.",n_circuit_failures); return -1; + } /* try a circ. if it fails, circuit_close will increment n_circuit_failures */ circuit_establish_circuit(); @@ -730,6 +733,7 @@ int circuit_launch_new(void) { void circuit_increment_failure_count(void) { ++n_circuit_failures; + log_fn(LOG_DEBUG,"n_circuit_failures now %d.",n_circuit_failures); } void circuit_reset_failure_count(void) { |