]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Clarify some documentation and comments wrt resetting OR token buckets
authorNick Mathewson <nickm@torproject.org>
Fri, 25 Mar 2011 21:21:16 +0000 (17:21 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 25 Mar 2011 22:32:28 +0000 (18:32 -0400)
src/or/connection_or.c
src/or/networkstatus.c

index ff863fd550511006b61284db2b88b9f23d8bc7bf..4b932ec51e0b9cc7ae49881ed0adce4909dc7e20 100644 (file)
@@ -353,6 +353,9 @@ connection_or_digest_is_known_relay(const char *id_digest)
  * per-conn limits that are big enough they'll never matter. But if it's
  * not a known relay, first check if we set PerConnBwRate/Burst, then
  * check if the consensus sets them, else default to 'big enough'.
+ *
+ * If <b>reset</b> is true, set the bucket to be full.  Otherwise, just
+ * clip the bucket if it happens to be <em>too</em> full.
  */
 static void
 connection_or_update_token_buckets_helper(or_connection_t *conn, int reset,
@@ -392,7 +395,8 @@ connection_or_update_token_buckets_helper(or_connection_t *conn, int reset,
 }
 
 /** Either our set of relays or our per-conn rate limits have changed.
- * Go through all the OR connections and update their token buckets. */
+ * Go through all the OR connections and update their token buckets to make
+ * sure they don't exceed their maximum values. */
 void
 connection_or_update_token_buckets(smartlist_t *conns, or_options_t *options)
 {
index 18cb4779e004b2424c7e087bbdbcbdeb8fc937fc..4f6fe15409bb3f3dd42f4f7e727fd072ae2ecc2d 100644 (file)
@@ -1747,7 +1747,8 @@ networkstatus_set_current_consensus(const char *consensus,
     routerstatus_list_update_named_server_map();
     cell_ewma_set_scale_factor(options, current_consensus);
 
-    /* XXX022 where is the right place to put this call? */
+    /* XXXX023 this call might be unnecessary here: can changing the
+     * current consensus really alter our view of any OR's rate limits? */
     connection_or_update_token_buckets(get_connection_array(), options);
 
     circuit_build_times_new_consensus_params(&circ_times, current_consensus);