diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-10-01 19:52:05 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-10-01 19:52:05 -0400 |
commit | b9f2ccbdcc222869b7561714c285db8b47e52e77 (patch) | |
tree | 3592078ecb7bde611ea761d7020e93976d6c609a /src/or/circuitbuild.c | |
parent | 1bb9734e3a745e2a16b58512f47a6db1229a2b75 (diff) | |
download | tor-b9f2ccbdcc222869b7561714c285db8b47e52e77.tar.gz tor-b9f2ccbdcc222869b7561714c285db8b47e52e77.zip |
More debugging code for node_t branch
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r-- | src/or/circuitbuild.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 58d4e60fa5..f485574408 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -2564,7 +2564,7 @@ choose_good_exit_server_general(int need_uptime, int need_capacity) */ continue; } - if (!node->ri && !(node->rs && node->md)) + if (!node_has_descriptor(node)) continue; if (!node->is_running || node->is_bad_exit) { n_supported[i] = -1; @@ -2684,6 +2684,8 @@ choose_good_exit_server_general(int need_uptime, int need_capacity) /* try once to pick only from routers that satisfy a needed port, * then if there are none, pick from any that support exiting. */ SMARTLIST_FOREACH_BEGIN(the_nodes, const node_t *, node) { + if (!node_has_descriptor(node)) + continue; if (n_supported[node_sl_idx] != -1 && (attempt || node_handles_some_port(node, needed_ports))) { // log_fn(LOG_DEBUG,"Try %d: '%s' is a possibility.", @@ -2860,6 +2862,7 @@ onion_pick_cpath_exit(origin_circuit_t *circ, extend_info_t *exit) return -1; } exit = extend_info_from_node(node); + tor_assert(exit); } state->chosen_exit = exit; return 0; @@ -3100,13 +3103,17 @@ onion_extend_cpath(origin_circuit_t *circ) info = extend_info_dup(state->chosen_exit); } else if (cur_len == 0) { /* picking first node */ const node_t *r = choose_good_entry_server(purpose, state); - if (r) + if (r) { info = extend_info_from_node(r); + tor_assert(info); + } } else { const node_t *r = choose_good_middle_server(purpose, state, circ->cpath, cur_len); - if (r) + if (r) { info = extend_info_from_node(r); + tor_assert(info); + } } if (!info) { |