Loading changes/ticket25163 0 → 100644 +4 −0 Original line number Diff line number Diff line o Code simplification and refactoring (rephist): - Remove a series of counters used to track circuit extend attemps and connection status but that in reality we aren't using for anything other than stats logged by a SIGUSR1 signal. Closes ticket 25163. src/or/channel.c +0 −1 Original line number Diff line number Diff line Loading @@ -1882,7 +1882,6 @@ channel_do_open_actions(channel_t *chan) if (started_here) { circuit_build_times_network_is_live(get_circuit_build_times_mutable()); rep_hist_note_connect_succeeded(chan->identity_digest, now); router_set_status(chan->identity_digest, 1); } else { /* only report it to the geoip module if it's not a known router */ Loading src/or/circuitbuild.c +0 −40 Original line number Diff line number Diff line Loading @@ -347,45 +347,6 @@ circuit_log_path(int severity, unsigned int domain, origin_circuit_t *circ) tor_free(s); } /** Tell the rep(utation)hist(ory) module about the status of the links * in <b>circ</b>. Hops that have become OPEN are marked as successfully * extended; the _first_ hop that isn't open (if any) is marked as * unable to extend. */ /* XXXX Someday we should learn from OR circuits too. */ void circuit_rep_hist_note_result(origin_circuit_t *circ) { crypt_path_t *hop; const char *prev_digest = NULL; hop = circ->cpath; if (!hop) /* circuit hasn't started building yet. */ return; if (server_mode(get_options())) { const routerinfo_t *me = router_get_my_routerinfo(); if (!me) return; prev_digest = me->cache_info.identity_digest; } do { const node_t *node = node_get_by_id(hop->extend_info->identity_digest); if (node) { /* Why do we check this? We know the identity. -NM XXXX */ if (prev_digest) { if (hop->state == CPATH_STATE_OPEN) rep_hist_note_extend_succeeded(prev_digest, node->identity); else { rep_hist_note_extend_failed(prev_digest, node->identity); break; } } prev_digest = node->identity; } else { prev_digest = NULL; } hop=hop->next; } while (hop!=circ->cpath); } /** Return 1 iff every node in circ's cpath definitely supports ntor. */ static int circuit_cpath_supports_ntor(const origin_circuit_t *circ) Loading Loading @@ -1075,7 +1036,6 @@ circuit_build_no_more_hops(origin_circuit_t *circ) } pathbias_count_build_success(circ); circuit_rep_hist_note_result(circ); if (is_usable_for_streams) circuit_has_opened(circ); /* do other actions as necessary */ Loading src/or/circuitbuild.h +0 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ char *circuit_list_path(origin_circuit_t *circ, int verbose); char *circuit_list_path_for_controller(origin_circuit_t *circ); void circuit_log_path(int severity, unsigned int domain, origin_circuit_t *circ); void circuit_rep_hist_note_result(origin_circuit_t *circ); origin_circuit_t *origin_circuit_init(uint8_t purpose, int flags); origin_circuit_t *circuit_establish_circuit(uint8_t purpose, extend_info_t *exit, Loading src/or/circuitlist.c +1 −3 Original line number Diff line number Diff line Loading @@ -1986,8 +1986,7 @@ circuit_mark_all_dirty_circs_as_unusable(void) * - If state is onionskin_pending, remove circ from the onion_pending * list. * - If circ isn't open yet: call circuit_build_failed() if we're * the origin, and in either case call circuit_rep_hist_note_result() * to note stats. * the origin. * - If purpose is C_INTRODUCE_ACK_WAIT, report the intro point * failure we just had to the hidden service client module. * - If purpose is C_INTRODUCING and <b>reason</b> isn't TIMEOUT, Loading Loading @@ -2123,7 +2122,6 @@ circuit_about_to_free(circuit_t *circ) if (CIRCUIT_IS_ORIGIN(circ)) { origin_circuit_t *ocirc = TO_ORIGIN_CIRCUIT(circ); circuit_build_failed(ocirc); /* take actions if necessary */ circuit_rep_hist_note_result(ocirc); } } if (circ->state == CIRCUIT_STATE_CHAN_WAIT) { Loading Loading
changes/ticket25163 0 → 100644 +4 −0 Original line number Diff line number Diff line o Code simplification and refactoring (rephist): - Remove a series of counters used to track circuit extend attemps and connection status but that in reality we aren't using for anything other than stats logged by a SIGUSR1 signal. Closes ticket 25163.
src/or/channel.c +0 −1 Original line number Diff line number Diff line Loading @@ -1882,7 +1882,6 @@ channel_do_open_actions(channel_t *chan) if (started_here) { circuit_build_times_network_is_live(get_circuit_build_times_mutable()); rep_hist_note_connect_succeeded(chan->identity_digest, now); router_set_status(chan->identity_digest, 1); } else { /* only report it to the geoip module if it's not a known router */ Loading
src/or/circuitbuild.c +0 −40 Original line number Diff line number Diff line Loading @@ -347,45 +347,6 @@ circuit_log_path(int severity, unsigned int domain, origin_circuit_t *circ) tor_free(s); } /** Tell the rep(utation)hist(ory) module about the status of the links * in <b>circ</b>. Hops that have become OPEN are marked as successfully * extended; the _first_ hop that isn't open (if any) is marked as * unable to extend. */ /* XXXX Someday we should learn from OR circuits too. */ void circuit_rep_hist_note_result(origin_circuit_t *circ) { crypt_path_t *hop; const char *prev_digest = NULL; hop = circ->cpath; if (!hop) /* circuit hasn't started building yet. */ return; if (server_mode(get_options())) { const routerinfo_t *me = router_get_my_routerinfo(); if (!me) return; prev_digest = me->cache_info.identity_digest; } do { const node_t *node = node_get_by_id(hop->extend_info->identity_digest); if (node) { /* Why do we check this? We know the identity. -NM XXXX */ if (prev_digest) { if (hop->state == CPATH_STATE_OPEN) rep_hist_note_extend_succeeded(prev_digest, node->identity); else { rep_hist_note_extend_failed(prev_digest, node->identity); break; } } prev_digest = node->identity; } else { prev_digest = NULL; } hop=hop->next; } while (hop!=circ->cpath); } /** Return 1 iff every node in circ's cpath definitely supports ntor. */ static int circuit_cpath_supports_ntor(const origin_circuit_t *circ) Loading Loading @@ -1075,7 +1036,6 @@ circuit_build_no_more_hops(origin_circuit_t *circ) } pathbias_count_build_success(circ); circuit_rep_hist_note_result(circ); if (is_usable_for_streams) circuit_has_opened(circ); /* do other actions as necessary */ Loading
src/or/circuitbuild.h +0 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ char *circuit_list_path(origin_circuit_t *circ, int verbose); char *circuit_list_path_for_controller(origin_circuit_t *circ); void circuit_log_path(int severity, unsigned int domain, origin_circuit_t *circ); void circuit_rep_hist_note_result(origin_circuit_t *circ); origin_circuit_t *origin_circuit_init(uint8_t purpose, int flags); origin_circuit_t *circuit_establish_circuit(uint8_t purpose, extend_info_t *exit, Loading
src/or/circuitlist.c +1 −3 Original line number Diff line number Diff line Loading @@ -1986,8 +1986,7 @@ circuit_mark_all_dirty_circs_as_unusable(void) * - If state is onionskin_pending, remove circ from the onion_pending * list. * - If circ isn't open yet: call circuit_build_failed() if we're * the origin, and in either case call circuit_rep_hist_note_result() * to note stats. * the origin. * - If purpose is C_INTRODUCE_ACK_WAIT, report the intro point * failure we just had to the hidden service client module. * - If purpose is C_INTRODUCING and <b>reason</b> isn't TIMEOUT, Loading Loading @@ -2123,7 +2122,6 @@ circuit_about_to_free(circuit_t *circ) if (CIRCUIT_IS_ORIGIN(circ)) { origin_circuit_t *ocirc = TO_ORIGIN_CIRCUIT(circ); circuit_build_failed(ocirc); /* take actions if necessary */ circuit_rep_hist_note_result(ocirc); } } if (circ->state == CIRCUIT_STATE_CHAN_WAIT) { Loading