summaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-08-17 12:10:44 -0400
committerNick Mathewson <nickm@torproject.org>2012-08-17 12:10:44 -0400
commita4669d8704af7e9d978cb392e6a8df79376207b3 (patch)
tree474e98e28119ea857cf76a1f693786c08ba20b64 /src/or/or.h
parent274e2817419e9b785f890fe04d791ed9114a8725 (diff)
parenta74d4182f106b1b89367cf1a640b1140d3d35d2c (diff)
downloadtor-a4669d8704af7e9d978cb392e6a8df79376207b3.tar.gz
tor-a4669d8704af7e9d978cb392e6a8df79376207b3.zip
Merge remote-tracking branch 'origin/maint-0.2.3'
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/or/or.h b/src/or/or.h
index 2ce95c661a..0e46df0c10 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -2602,6 +2602,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 {
@@ -2635,6 +2652,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