diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-11-29 11:47:12 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-12-16 11:06:19 -0500 |
commit | 84bfa895d725338d92f677a31a4dcf6381845e0c (patch) | |
tree | 048ac001141964a38514f0f061c32601cd46c251 /src/or/entrynodes.h | |
parent | 46619ec9143450b181a8510011d3e3fd92542aa4 (diff) | |
download | tor-84bfa895d725338d92f677a31a4dcf6381845e0c.tar.gz tor-84bfa895d725338d92f677a31a4dcf6381845e0c.zip |
Change return value of entry_guard_succeeded to an enum.
George pointed out that (-1,0,1) for (never usable, maybe usable
later, usable right now) was a pretty rotten convention that made
the code harder to read.
Diffstat (limited to 'src/or/entrynodes.h')
-rw-r--r-- | src/or/entrynodes.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/entrynodes.h b/src/or/entrynodes.h index 21dab6ea18..ceccd0ff10 100644 --- a/src/or/entrynodes.h +++ b/src/or/entrynodes.h @@ -359,7 +359,12 @@ void circuit_guard_state_free(circuit_guard_state_t *state); int entry_guard_pick_for_circuit(guard_selection_t *gs, const node_t **chosen_node_out, circuit_guard_state_t **guard_state_out); -int entry_guard_succeeded(circuit_guard_state_t **guard_state_p); +typedef enum { + GUARD_USABLE_NEVER = -1, + GUARD_MAYBE_USABLE_LATER = 0, + GUARD_USABLE_NOW = 1, +} guard_usable_t; +guard_usable_t entry_guard_succeeded(circuit_guard_state_t **guard_state_p); void entry_guard_failed(circuit_guard_state_t **guard_state_p); void entry_guard_cancel(circuit_guard_state_t **guard_state_p); void entry_guard_chan_failed(channel_t *chan); |