diff options
author | Chelsea H. Komlo <chelsea.komlo@gmail.com> | 2016-11-21 15:12:21 -0500 |
---|---|---|
committer | Chelsea H. Komlo <chelsea.komlo@gmail.com> | 2016-11-24 09:33:32 -0500 |
commit | b252773fe912aa398741c1ec3d2a8eeabf7a52dc (patch) | |
tree | 80d844467d2592d46dafd68aed7d7817f74ea117 /src/or/circuituse.c | |
parent | c86bbdd3aea050537dfe659013c1db2aa481bf06 (diff) | |
download | tor-b252773fe912aa398741c1ec3d2a8eeabf7a52dc.tar.gz tor-b252773fe912aa398741c1ec3d2a8eeabf7a52dc.zip |
re-add check for if circuit is an origin circuit
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r-- | src/or/circuituse.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c index 6fb4f82b6d..cceaddd13d 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -1033,12 +1033,15 @@ circuit_is_available_for_use(const circuit_t *circ) const origin_circuit_t *origin_circ; cpath_build_state_t *build_state; + if (!CIRCUIT_IS_ORIGIN(circ)) + return 0; /* We first filter out only origin circuits before doing the + following checks. */ if (circ->marked_for_close) return 0; /* Don't mess with marked circs */ if (circ->timestamp_dirty) return 0; /* Only count clean circs */ if (circ->purpose != CIRCUIT_PURPOSE_C_GENERAL) - return 0; /* Only pay attention to general purpose circuits. + return 0; /* We only pay attention to general purpose circuits. General purpose circuits are always origin circuits. */ origin_circ = CONST_TO_ORIGIN_CIRCUIT(circ); |