[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] [tor/master] Fix up comments in choose_good_entry_server. Spotted by Robert Ransom.



Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Fri, 29 Oct 2010 15:55:39 -0400
Subject: Fix up comments in choose_good_entry_server.  Spotted by Robert Ransom.
Commit: da0912c00c993b62040f33d2fa57637f010eb7e4

---
 src/or/circuitbuild.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index f8a198b..20a7a0d 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -3022,23 +3022,28 @@ choose_good_entry_server(uint8_t purpose, cpath_build_state_t *state)
 
   if (state && options->UseEntryGuards &&
       (purpose != CIRCUIT_PURPOSE_TESTING || options->BridgeRelay)) {
+    /* This is request for an entry server to use for a regular circuit,
+     * and we use entry guard nodes.  Just return one of the guard nodes.  */
     return choose_random_entry(state);
   }
 
   excluded = smartlist_create();
 
   if (state && (node = build_state_get_exit_node(state))) {
+    /* Exclude the exit node from the state, if we have one.  Also exclude its
+     * family. */
     smartlist_add(excluded, (void*)node);
     nodelist_add_node_family(excluded, node);
   }
   if (firewall_is_fascist_or()) {
+    /* Exclude all ORs that we can't reach through our firewall */
     smartlist_t *nodes = nodelist_get_list();
-    SMARTLIST_FOREACH(nodes, const node_t *,node, {
+    SMARTLIST_FOREACH(nodes, const node_t *, node, {
       if (!fascist_firewall_allows_node(node))
         smartlist_add(excluded, (void*)node);
     });
   }
-  /* and exclude current entry guards, if applicable */
+  /* and exclude current entry guards and their families, if applicable */
   if (options->UseEntryGuards && entry_guards) {
     SMARTLIST_FOREACH(entry_guards, entry_guard_t *, entry,
       {
-- 
1.7.1