diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-09-18 16:20:01 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-09-18 16:20:01 -0400 |
commit | 920c76a2fcc843bc58b79195414d3ed4b693e76e (patch) | |
tree | 95392e59c5ea244615d1643dd77e57aaaed453e7 /src/or | |
parent | f675e0a33efa5f32377e784b2612c2b6a5c9180b (diff) | |
parent | aca325eb0c6b34ba0e1ef8df16c1cf44a98f9b6f (diff) | |
download | tor-920c76a2fcc843bc58b79195414d3ed4b693e76e.tar tor-920c76a2fcc843bc58b79195414d3ed4b693e76e.tar.gz |
Merge remote-tracking branch 'origin/maint-0.2.3'
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/circuitbuild.c | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 515312f0e..840031da5 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -2657,8 +2657,24 @@ pathbias_count_first_hop(origin_circuit_t *circ) } /* Completely ignore one hop circuits */ - if (circ->build_state->onehop_tunnel) { - tor_assert(circ->build_state->desired_path_len == 1); + if (circ->build_state->onehop_tunnel || + circ->build_state->desired_path_len == 1) { + /* Check for inconsistency */ + if (circ->build_state->desired_path_len != 1 || + !circ->build_state->onehop_tunnel) { + if ((rate_msg = rate_limit_log(&first_hop_notice_limit, + approx_time()))) { + log_info(LD_BUG, + "One-hop circuit has length %d. Path state is %s. " + "Circuit is a %s currently %s. %s", + circ->build_state->desired_path_len, + pathbias_state_to_string(circ->path_state), + circuit_purpose_to_string(circ->_base.purpose), + circuit_state_to_string(circ->_base.state), + rate_msg); + } + tor_fragile_assert(); + } return 0; } @@ -2759,8 +2775,24 @@ pathbias_count_success(origin_circuit_t *circ) } /* Ignore one hop circuits */ - if (circ->build_state->onehop_tunnel) { - tor_assert(circ->build_state->desired_path_len == 1); + if (circ->build_state->onehop_tunnel || + circ->build_state->desired_path_len == 1) { + /* Check for consistency */ + if (circ->build_state->desired_path_len != 1 || + !circ->build_state->onehop_tunnel) { + if ((rate_msg = rate_limit_log(&success_notice_limit, + approx_time()))) { + log_info(LD_BUG, + "One-hop circuit has length %d. Path state is %s. " + "Circuit is a %s currently %s. %s", + circ->build_state->desired_path_len, + pathbias_state_to_string(circ->path_state), + circuit_purpose_to_string(circ->_base.purpose), + circuit_state_to_string(circ->_base.state), + rate_msg); + } + tor_fragile_assert(); + } return; } |