diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-08-17 12:08:42 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-08-17 12:08:42 -0400 |
commit | 3621f30ad44973acef1ae0dc2e723fd8c9f1dc0d (patch) | |
tree | bc1203681b68064c851fdebc3ad0ee2106f87192 /src/or/or.h | |
parent | f25e8d034b78be01c9fbe659d4686fc370083572 (diff) | |
parent | 4e42a8a2f20e501f9236452b41939964e6d942cf (diff) | |
download | tor-3621f30ad44973acef1ae0dc2e723fd8c9f1dc0d.tar.gz tor-3621f30ad44973acef1ae0dc2e723fd8c9f1dc0d.zip |
Merge remote-tracking branch 'mikeperry/bug6475' into maint-0.2.3
Diffstat (limited to 'src/or/or.h')
-rw-r--r-- | src/or/or.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/or/or.h b/src/or/or.h index 3a53e5ed86..d2cafb545a 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -2596,6 +2596,23 @@ typedef struct circuit_t { * circuit. */ #define MAX_RELAY_EARLY_CELLS_PER_CIRCUIT 8 +/** + * Describes the circuit building process in simplified terms based + * on the path bias accounting state for a circuit. Created to prevent + * overcounting due to unknown cases of circuit reuse. See Bug #6475. + */ +typedef enum { + /** This circuit is "new". It has not yet completed a first hop + * or been counted by the path bias code. */ + PATH_STATE_NEW_CIRC = 0, + /** This circuit has completed a first hop, and has been counted by + * the path bias logic. */ + PATH_STATE_DID_FIRST_HOP = 1, + /** This circuit has been completely built, and has been counted as + * successful by the path bias logic. */ + PATH_STATE_SUCCEEDED = 2, +} path_state_t; + /** An origin_circuit_t holds data necessary to build and use a circuit. */ typedef struct origin_circuit_t { @@ -2629,6 +2646,10 @@ typedef struct origin_circuit_t { * cannibalized circuits. */ unsigned int has_opened : 1; + /** Kludge to help us prevent the warn in bug #6475 and eventually + * debug why we are not seeing first hops in some cases. */ + path_state_t path_state : 2; + /** Set iff this is a hidden-service circuit which has timed out * according to our current circuit-build timeout, but which has * been kept around because it might still succeed in connecting to |