mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 14:23:30 +01:00
simplify some code, since circuit_build_failed() is only called
on non-open circuits. svn:r6540
This commit is contained in:
parent
152d6d13b4
commit
8f3bb66ebc
@ -691,12 +691,8 @@ circuit_build_failed(circuit_t *circ)
|
|||||||
|
|
||||||
switch (circ->purpose) {
|
switch (circ->purpose) {
|
||||||
case CIRCUIT_PURPOSE_C_GENERAL:
|
case CIRCUIT_PURPOSE_C_GENERAL:
|
||||||
if (circ->state != CIRCUIT_STATE_OPEN) {
|
/* If we never built the circuit, note it as a failure. */
|
||||||
/* If we never built the circuit, note it as a failure. */
|
circuit_increment_failure_count();
|
||||||
/* Note that we can't just check circ->cpath here, because if
|
|
||||||
* circuit-building failed immediately, it won't be set yet. */
|
|
||||||
circuit_increment_failure_count();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case CIRCUIT_PURPOSE_TESTING:
|
case CIRCUIT_PURPOSE_TESTING:
|
||||||
circuit_testing_failed(circ, failed_at_last_hop);
|
circuit_testing_failed(circ, failed_at_last_hop);
|
||||||
@ -718,9 +714,7 @@ circuit_build_failed(circuit_t *circ)
|
|||||||
break;
|
break;
|
||||||
case CIRCUIT_PURPOSE_C_ESTABLISH_REND:
|
case CIRCUIT_PURPOSE_C_ESTABLISH_REND:
|
||||||
/* at Alice, waiting for Bob */
|
/* at Alice, waiting for Bob */
|
||||||
if (circ->state != CIRCUIT_STATE_OPEN) {
|
circuit_increment_failure_count();
|
||||||
circuit_increment_failure_count();
|
|
||||||
}
|
|
||||||
/* Alice will pick a new rend point when this one dies, if
|
/* Alice will pick a new rend point when this one dies, if
|
||||||
* the stream in question still cares. No need to act here. */
|
* the stream in question still cares. No need to act here. */
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user