From: Roger Dingledine Date: Mon, 26 Dec 2005 05:52:44 +0000 (+0000) Subject: comments? i'll show you comments. X-Git-Tag: tor-0.1.1.11-alpha~132 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=815df977cfbb1f7ebf1b78e2633367eae352a833;p=thirdparty%2Ftor.git comments? i'll show you comments. svn:r5652 --- diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index a9c169c595..584b22384c 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -1380,7 +1380,10 @@ circuit_append_new_exit(circuit_t *circ, extend_info_t *info) return 0; } -/** DOCDOC */ +/** Take an open circ, and add a new hop at the end, based on + * info. Set its state back to CIRCUIT_STATE_BUILDING, and then + * send the next extend cell to begin connecting to that hop. + */ int circuit_extend_to_new_exit(circuit_t *circ, extend_info_t *info) { @@ -1429,7 +1432,6 @@ count_acceptable_routers(smartlist_t *routers) } /** Add new_hop to the end of the doubly-linked-list head_ptr. - * * This function is used to extend cpath by another hop. */ void @@ -1446,7 +1448,12 @@ onion_append_to_cpath(crypt_path_t **head_ptr, crypt_path_t *new_hop) } } -/** DOCDOC */ +/** A helper function used by onion_extend_cpath(). Use purpose + * and state and the cpath head (currently populated only + * to length cur_len to decide a suitable middle hop for a + * circuit. In particular, make sure we don't pick the exit node or its + * family, and make sure we don't duplicate any previous nodes or their + * families. */ static routerinfo_t * choose_good_middle_server(uint8_t purpose, cpath_build_state_t *state, @@ -1667,10 +1674,9 @@ extend_info_dup(extend_info_t *info) return newinfo; } -/** - * Return the routerinfo_t for the chosen exit router in state. If - * there is no chosen exit, or if we don't know the routerinfo_t for the - * chosen exit, return NULL. +/** Return the routerinfo_t for the chosen exit router in state. + * If there is no chosen exit, or if we don't know the routerinfo_t for + * the chosen exit, return NULL. */ routerinfo_t * build_state_get_exit_router(cpath_build_state_t *state) @@ -1680,8 +1686,7 @@ build_state_get_exit_router(cpath_build_state_t *state) return router_get_by_digest(state->chosen_exit->identity_digest); } -/** - * Return the nickname for the chosen exit router in state. If +/** Return the nickname for the chosen exit router in state. If * there is no chosen exit, or if we don't know the routerinfo_t for the * chosen exit, return NULL. */ @@ -1706,8 +1711,8 @@ num_live_helpers(void) return n; } -/** If the use of helper nodes is configured, choose more helper nodes until - * we have enough in the list. */ +/** If the use of helper nodes is configured, choose more helper nodes + * until we have enough in the list. */ static void pick_helper_nodes(void) { @@ -1758,15 +1763,15 @@ helper_nodes_free_all(void) } } -/** How long (in seconds) do we allow a helper node to be nonfunctional before - * we give up on it? */ +/** How long (in seconds) do we allow a helper node to be nonfunctional + * before we give up on it? */ #define HELPER_ALLOW_DOWNTIME 48*60*60 /** How long (in seconds) do we allow a helper node to be unlisted in the * directory before we give up on it? */ #define HELPER_ALLOW_UNLISTED 48*60*60 -/** Remove all helper nodes that have been down or unlisted for so long that - * we don't think they'll come up again. */ +/** Remove all helper nodes that have been down or unlisted for so + * long that we don't think they'll come up again. */ static void remove_dead_helpers(void) {