aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_or.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2010-09-28 23:27:00 -0400
committerRoger Dingledine <arma@torproject.org>2010-09-28 23:27:00 -0400
commit512433346f01f054e99c2dccede324a41a819fe8 (patch)
tree5e759910fad38a091569e93359467e5febb96498 /src/or/connection_or.c
parent7e644b3f691e44642cc267b62cf49a7e4bffd383 (diff)
downloadtor-512433346f01f054e99c2dccede324a41a819fe8.tar
tor-512433346f01f054e99c2dccede324a41a819fe8.tar.gz
improve code comments, based on comments from nick
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r--src/or/connection_or.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 836e7faef..09f310a3d 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -606,8 +606,21 @@ connection_or_get_for_extend(const char *digest,
#define TIME_BEFORE_OR_CONN_IS_TOO_OLD (60*60*24*7)
/** Given the head of the linked list for all the or_connections with a given
- * identity, set elements of that list as is_bad_for_new_circs() as
- * appropriate. Helper for connection_or_set_bad_connections().
+ * identity, set elements of that list as is_bad_for_new_circs as
+ * appropriate. Helper for connection_or_set_bad_connections().
+ *
+ * Specifically, we set the is_bad_for_new_circs flag on:
+ * - all connections if <b>force</b> is true.
+ * - all connections that are too old.
+ * - all open non-canonical connections for which a canonical connection
+ * exists to the same router.
+ * - all open canonical connections for which a 'better' canonical
+ * connection exists to the same router.
+ * - all open non-canonical connections for which a 'better' non-canonical
+ * connection exists to the same router at the same address.
+ *
+ * See connection_or_is_better() for our idea of what makes one OR connection
+ * better than another.
*/
static void
connection_or_group_set_badness(or_connection_t *head, int force)
@@ -721,18 +734,8 @@ connection_or_group_set_badness(or_connection_t *head, int force)
/** Go through all the OR connections (or if <b>digest</b> is non-NULL, just
* the OR connections with that digest), and set the is_bad_for_new_circs
- * flag on:
- * - all connections if <b>force</b> is true.
- * - all connections that are too old.
- * - all open non-canonical connections for which a canonical connection
- * exists to the same router.
- * - all open canonical connections for which a 'better' canonical
- * connection exists to the same router.
- * - all open non-canonical connections for which a 'better' non-canonical
- * connection exists to the same router at the same address.
- *
- * See connection_or_is_better() for our idea of what makes one OR connection
- * better than another.
+ * flag based on the rules in connection_or_group_set_badness() (or just
+ * always set it if <b>force</b> is true).
*/
void
connection_or_set_bad_connections(const char *digest, int force)