summaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@torproject.org>2017-09-20 20:24:59 +0000
committerMike Perry <mikeperry-git@torproject.org>2017-12-07 00:04:39 +0000
commit050bb67974c11e0f390f4b1fa1b067c86538c59e (patch)
tree7ecf0e8ceaca199177e203c8d35936ae41279899 /src/or/circuituse.c
parent125df07d609933a7974f362706b126a4bf339788 (diff)
downloadtor-050bb67974c11e0f390f4b1fa1b067c86538c59e.tar.gz
tor-050bb67974c11e0f390f4b1fa1b067c86538c59e.zip
Add tests for circuitstats.c
These tests primarily test the relaxed and measured behavior of circuitstats.c, to make sure we did not break it with #23100 or #23114.
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r--src/or/circuituse.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 1335e12c6a..d4657921ea 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -585,7 +585,8 @@ circuit_expire_building(void)
TO_ORIGIN_CIRCUIT(victim)->build_state->desired_path_len :
-1,
circuit_state_to_string(victim->state),
- channel_state_to_string(victim->n_chan->state));
+ victim->n_chan ?
+ channel_state_to_string(victim->n_chan->state) : "none");
/* We count the timeout here for CBT, because technically this
* was a timeout, and the timeout value needs to reset if we
@@ -610,7 +611,8 @@ circuit_expire_building(void)
TO_ORIGIN_CIRCUIT(victim)->build_state->desired_path_len :
-1,
circuit_state_to_string(victim->state),
- channel_state_to_string(victim->n_chan->state),
+ victim->n_chan ?
+ channel_state_to_string(victim->n_chan->state) : "none",
(long)build_close_ms);
}
}