aboutsummaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@fscked.org>2010-06-15 01:13:49 -0700
committerMike Perry <mikeperry-git@fscked.org>2010-06-15 20:04:42 -0700
commitc6c8fbf852bb2ecee6387609e8cbf78a772c7e01 (patch)
treed240f87d82c54e3a59d5801519c45e0e6b2bde10 /src/or/or.h
parentf528a6e62b75538a39b113f67e38fb947c80739e (diff)
downloadtor-c6c8fbf852bb2ecee6387609e8cbf78a772c7e01.tar.gz
tor-c6c8fbf852bb2ecee6387609e8cbf78a772c7e01.zip
Split the circuit timeout and close codepaths.
We need to record different statistics at point of timeout, vs the point of forcible closing. Also, give some better names to constants and state file variables to indicate they are not dealing with timeouts, but abandoned circuits.
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/or/or.h b/src/or/or.h
index 1f1ffe00eb..e1483e6466 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -2842,7 +2842,7 @@ typedef struct {
/** Build time histogram */
config_line_t * BuildtimeHistogram;
unsigned int TotalBuildTimes;
- unsigned int CircuitBuildTimeoutCount;
+ unsigned int CircuitBuildAbandonedCount;
/** What version of Tor wrote this state file? */
char *TorVersion;
@@ -3027,7 +3027,12 @@ void entry_guards_free_all(void);
/** A build_time_t is milliseconds */
typedef uint32_t build_time_t;
-#define CBT_BUILD_TIMEOUT ((build_time_t)(INT32_MAX-1))
+
+/**
+ * CBT_BUILD_ABANDONED is our flag value to represent a force-closed
+ * circuit (Aka a 'right-censored' pareto value).
+ */
+#define CBT_BUILD_ABANDONED ((build_time_t)(INT32_MAX-1))
#define CBT_BUILD_TIME_MAX ((build_time_t)(INT32_MAX))
/** Save state every 10 circuits */
@@ -3152,7 +3157,9 @@ void circuit_build_times_update_state(circuit_build_times_t *cbt,
or_state_t *state);
int circuit_build_times_parse_state(circuit_build_times_t *cbt,
or_state_t *state, char **msg);
-int circuit_build_times_add_timeout(circuit_build_times_t *cbt,
+void circuit_build_times_count_timeout(circuit_build_times_t *cbt,
+ int did_onehop);
+int circuit_build_times_count_close(circuit_build_times_t *cbt,
int did_onehop, time_t start_time);
void circuit_build_times_set_timeout(circuit_build_times_t *cbt);
int circuit_build_times_add_time(circuit_build_times_t *cbt,