Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ZerXes
Tor
Commits
7a3a3ae1
Commit
7a3a3ae1
authored
Dec 13, 2003
by
Roger Dingledine
Browse files
bugfix: a circuit that immediately failed still counts as a failed circuit
svn:r905
parent
9e6f4a30
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/or/circuit.c
View file @
7a3a3ae1
...
...
@@ -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
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment