]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
what the heck is wrong with this little piece of code?
authorRoger Dingledine <arma@torproject.org>
Wed, 7 Dec 2005 04:43:39 +0000 (04:43 +0000)
committerRoger Dingledine <arma@torproject.org>
Wed, 7 Dec 2005 04:43:39 +0000 (04:43 +0000)
why can none of us get it right?
it looks so simple.

svn:r5521

src/or/circuitbuild.c
src/or/connection_edge.c

index f542804d20cc7a163955e13c1c7e4a9adb79561d..0acc46571459b41de0a83fdd890817012ad6472c 100644 (file)
@@ -1431,9 +1431,9 @@ choose_good_middle_server(uint8_t purpose,
 }
 
 /** Pick a good entry server for the circuit to be built according to
- * <b>state</b>.  Don't reuse a chosen exit (if any), don't use this router
- * (if we're an OR), and respect firewall settings; if we're using helper nodes,
- * return one.
+ * <b>state</b>.  Don't reuse a chosen exit (if any), don't use this
+ * router (if we're an OR), and respect firewall settings; if we're
+ * using helper nodes, return one.
  *
  * If <b>state</b> is NULL, we're choosing entries to serve as helper nodes,
  * not for any particular circuit.
@@ -1468,6 +1468,8 @@ choose_good_entry_server(cpath_build_state_t *state)
         smartlist_add(excluded, r);
     }
   }
+  // XXX we should exclude busy exit nodes here, too,
+  // but only if there are enough other nodes available.
   choice = router_choose_random_node(options->EntryNodes, options->ExcludeNodes,
            excluded, state ? state->need_uptime : 1,
            state ? state->need_capacity : 0,
index f376d3df803e9999249c98327335a6ed5334eaa9..e41580ffd87cac05e83050f7bdcdbb91ad2632fa 100644 (file)
@@ -1005,8 +1005,9 @@ connection_ap_handshake_process_socks(connection_t *conn)
       }
     } else {
       struct in_addr in;
-      routerinfo_t *r = router_get_by_nickname(conn->chosen_exit_name, 1);
+      routerinfo_t *r;
       conn->chosen_exit_name = tor_strdup(socks->address);
+      r = router_get_by_nickname(conn->chosen_exit_name, 1);
       *socks->address = 0;
       if (r) {
         /* XXXX Should this use server->address instead? */