diff options
author | Roger Dingledine <arma@torproject.org> | 2007-02-24 01:12:53 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-02-24 01:12:53 +0000 |
commit | 9946bb7fbd85eb27a7a1e8ded7bac2881e1da4bf (patch) | |
tree | c7f1b087730695e1d6da38d0e26d83e9444e34a6 /src/or | |
parent | 4e05ccb289aaf5b8afc24888dedd4bd9bda285ef (diff) | |
download | tor-9946bb7fbd85eb27a7a1e8ded7bac2881e1da4bf.tar.gz tor-9946bb7fbd85eb27a7a1e8ded7bac2881e1da4bf.zip |
cosmetic, comment, and todo fixes
svn:r9627
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/circuitlist.c | 5 | ||||
-rw-r--r-- | src/or/connection_or.c | 10 | ||||
-rw-r--r-- | src/or/dirserv.c | 23 | ||||
-rw-r--r-- | src/or/main.c | 4 | ||||
-rw-r--r-- | src/or/or.h | 4 |
5 files changed, 23 insertions, 23 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index 3f00f2da7d..ed02e4a17c 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -751,10 +751,7 @@ circuit_get_intro_point(const char *digest) * if required, and if info is defined, does not already use info * as any of its hops; or NULL if no circuit fits this description. * - * Return need_uptime circuits if that is requested; and if it's not - * requested, return non-uptime circuits if possible, else either. - * - * Only return internal circuits if that is requested. + * If ! need_uptime, prefer returning non-uptime circuits. */ origin_circuit_t * circuit_find_to_cannibalize(uint8_t purpose, extend_info_t *info, diff --git a/src/or/connection_or.c b/src/or/connection_or.c index 44873b508c..bd1554be5b 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -37,8 +37,8 @@ connection_or_remove_from_identity_map(or_connection_t *conn) tmp = digestmap_get(orconn_identity_map, conn->identity_digest); if (!tmp) { if (!tor_digest_is_zero(conn->identity_digest)) { - log_warn(LD_BUG, "Didn't found connection on identity map when trying " - "to remove it."); + log_warn(LD_BUG, "Bug: Didn't find connection on identity map when " + "trying to remove it."); } return; } @@ -86,7 +86,7 @@ connection_or_clear_identity_map(void) } /** Change conn->identity_digest to digest, and add conn into - * orconn_digest_map. */ + * orconn_digest_map. */ static void connection_or_set_identity_digest(or_connection_t *conn, const char *digest) { @@ -105,7 +105,7 @@ connection_or_set_identity_digest(or_connection_t *conn, const char *digest) memcpy(conn->identity_digest, digest, DIGEST_LEN); - /* If we're setting the ID to zero, don't add a mapping.*/ + /* If we're setting the ID to zero, don't add a mapping. */ if (tor_digest_is_zero(digest)) return; @@ -658,7 +658,7 @@ connection_or_check_valid_handshake(or_connection_t *conn, int started_here, DIGEST_LEN); log_fn(severity, LD_OR, "Tried connecting to router at %s:%d, but identity key was not " - "as expected wanted %s but got %s", + "as expected: wanted %s but got %s.", conn->_base.address, conn->_base.port, expected, seen); entry_guard_register_connect_status(conn->identity_digest,0,time(NULL)); router_set_status(conn->identity_digest, 0); diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 2107f9e4ac..07ebe77177 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -1028,8 +1028,11 @@ _free_cached_dir(void *_d) cached_dir_decref(d); } -/** If we have no cached directory, or it is older than <b>when</b>, then - * replace it with <b>directory</b>, published at <b>when</b>. +/** If we have no cached directory, or it is older than <b>published</b>, + * then replace it with <b>directory</b>, published at <b>published</b>. + * + * If <b>is_running_routers</b>, this is really a running_routers document + * rather than a v1 directory. */ void dirserv_set_cached_directory(const char *directory, time_t published, @@ -1140,15 +1143,15 @@ dirserv_clear_old_networkstatuses(time_t cutoff) } } -/** Remove any networkstatus from the directory cache that was published - * before <b>cutoff</b>. */ +/** Remove any v1 info from the directory cache that was published + * too long ago. */ void dirserv_clear_old_v1_info(time_t now) { #define MAX_V1_DIRECTORY_AGE (30*24*60*60) #define MAX_V1_RR_AGE (7*24*60*60) if (cached_directory && - cached_directory->published < (now-MAX_V1_DIRECTORY_AGE)) { + cached_directory->published < (now - MAX_V1_DIRECTORY_AGE)) { cached_dir_decref(cached_directory); } if (cached_runningrouters.published < (now - MAX_V1_RR_AGE)) { @@ -1226,7 +1229,7 @@ dirserv_get_obj(const char **out, /** Return the most recently generated encoded signed directory, generating a * new one as necessary. If not an authoritative directory may return NULL if - * no directory is yet cached.*/ + * no directory is yet cached. */ cached_dir_t * dirserv_get_directory(void) { @@ -1267,7 +1270,7 @@ dirserv_regenerate_directory(void) return the_directory; } -/** For authoritative directories: the current (v1) network status */ +/** For authoritative directories: the current (v1) network status. */ static cached_dir_t the_runningrouters = { NULL, NULL, 0, 0, 0, -1 }; /** Replace the current running-routers list with a newly generated one. */ @@ -1337,7 +1340,7 @@ dirserv_get_runningrouters(const char **rr, int compress) "v1 network status list", 1); } -/** For authoritative directories: the current (v2) network status */ +/** For authoritative directories: the current (v2) network status. */ static cached_dir_t *the_v2_networkstatus = NULL; /** Return true iff our opinion of the routers has been stale for long @@ -1390,8 +1393,8 @@ dirserv_thinks_router_is_unreliable(time_t now, return 0; } -/** Helper: returns a tristate based on comparing **(uint32_t**)a to -* **(uint32_t**)b. */ +/** Helper: returns a tristate based on comparing **(uint32_t**)<b>a</b> + * to **(uint32_t**)<b>b</b>. */ static int _compare_uint32(const void **a, const void **b) { diff --git a/src/or/main.c b/src/or/main.c index 9b7cea697b..4403a66e29 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -1807,8 +1807,8 @@ struct service_fns { NULL, NULL, NULL, NULL, NULL, NULL, NULL}; -/** Loads functions used by NT services. Returns 0 on success, exits on - * error. */ +/** Loads functions used by NT services. Returns on success, or prints a + * complaint to stdout and exits on error. */ static void nt_service_loadlibrary(void) { diff --git a/src/or/or.h b/src/or/or.h index 24dd986d1f..1eb8702f32 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -797,8 +797,8 @@ typedef struct connection_t { typedef struct or_connection_t { connection_t _base; - /** Hash of the public RSA key for the other side's identity key, or zero if - * the other side hasn't shown us a valid identity key. */ + /** Hash of the public RSA key for the other side's identity key, or zeroes + * if the other side hasn't shown us a valid identity key. */ char identity_digest[DIGEST_LEN]; char *nickname; /**< Nickname of OR on other side (if any). */ |