aboutsummaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@fscked.org>2012-08-16 16:29:19 -0700
committerMike Perry <mikeperry-git@fscked.org>2012-08-16 16:29:19 -0700
commit4e42a8a2f20e501f9236452b41939964e6d942cf (patch)
tree52fd4fa188a857ec59185d9461e352efccfb84e0 /src/or/or.h
parentec6a7effb80af21484d83fd45d4e5eeb7c993dd4 (diff)
downloadtor-4e42a8a2f20e501f9236452b41939964e6d942cf.tar.gz
tor-4e42a8a2f20e501f9236452b41939964e6d942cf.zip
Address Nick's comments from code review.
Also promote log messages to notice and rate-limit them.
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/or/or.h b/src/or/or.h
index 0db6137e97..d2cafb545a 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -2596,9 +2596,20 @@ 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;
@@ -2637,7 +2648,7 @@ typedef struct origin_circuit_t {
/** 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;
+ 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