aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-09-10 21:40:29 +0000
committerRoger Dingledine <arma@torproject.org>2004-09-10 21:40:29 +0000
commit959199340a8b777f13a6b5ce921d9d8eab9510e0 (patch)
treecce82bedbd69dc6732467e81e71c886597ec5161 /src/or
parent8954cd91ce5055789077c5ae56484638de21ab0a (diff)
downloadtor-959199340a8b777f13a6b5ce921d9d8eab9510e0.tar
tor-959199340a8b777f13a6b5ce921d9d8eab9510e0.tar.gz
don't pick administrative-friends when picking your path
(just a skeleton for now) svn:r2349
Diffstat (limited to 'src/or')
-rw-r--r--src/or/circuitbuild.c17
-rw-r--r--src/or/config.c3
-rw-r--r--src/or/or.h1
-rw-r--r--src/or/routerlist.c7
4 files changed, 23 insertions, 5 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 12b2afe90..7acb876bc 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -1074,14 +1074,19 @@ static routerinfo_t *choose_good_middle_server(cpath_build_state_t *state,
log_fn(LOG_DEBUG, "Contemplating intermediate hop: random choice.");
excluded = smartlist_create();
- if((r = router_get_by_digest(state->chosen_exit_digest)))
+ if((r = router_get_by_digest(state->chosen_exit_digest))) {
smartlist_add(excluded, r);
- if((r = routerlist_find_my_routerinfo()))
+ routerlist_add_friends(excluded, r);
+ }
+ if((r = routerlist_find_my_routerinfo())) {
smartlist_add(excluded, r);
+ routerlist_add_friends(excluded, r);
+ }
for (i = 0, cpath = head; i < cur_len; ++i, cpath=cpath->next) {
r = router_get_by_digest(cpath->identity_digest);
tor_assert(r);
smartlist_add(excluded, r);
+ routerlist_add_friends(excluded, r);
}
choice = router_choose_random_node("", options.ExcludeNodes, excluded,
0, 1, options._AllowUnverified & ALLOW_UNVERIFIED_MIDDLE, 0);
@@ -1095,10 +1100,14 @@ static routerinfo_t *choose_good_entry_server(cpath_build_state_t *state)
smartlist_t *excluded = smartlist_create();
char buf[16];
- if((r = router_get_by_digest(state->chosen_exit_digest)))
+ if((r = router_get_by_digest(state->chosen_exit_digest))) {
smartlist_add(excluded, r);
- if((r = routerlist_find_my_routerinfo()))
+ routerlist_add_friends(excluded, r);
+ }
+ if((r = routerlist_find_my_routerinfo())) {
smartlist_add(excluded, r);
+ routerlist_add_friends(excluded, r);
+ }
if(options.FascistFirewall) {
/* exclude all ORs that listen on the wrong port */
routerlist_t *rl;
diff --git a/src/or/config.c b/src/or/config.c
index 6f78b0b66..7e060efa1 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1045,7 +1045,8 @@ const char *get_data_directory(or_options_t *options) {
if (d && strncmp(d,"~/",2)==0) {
char *fn = expand_filename(d);
if(!fn) {
- /* XXX complain and exit(1) here */
+ log_fn(LOG_ERR,"Failed to expand filename '%s'. Exiting.",d);
+ exit(1);
}
tor_free(options->DataDirectory);
options->DataDirectory = fn;
diff --git a/src/or/or.h b/src/or/or.h
index c04403aac..04f02aba2 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -1394,6 +1394,7 @@ int router_reload_router_list(void);
routerinfo_t *router_pick_directory_server(int requireauth, int requireothers);
int all_directory_servers_down(void);
struct smartlist_t;
+void routerlist_add_friends(struct smartlist_t *sl, routerinfo_t *router);
void add_nickname_list_to_smartlist(struct smartlist_t *sl, const char *list, int warn_if_down);
routerinfo_t *routerlist_find_my_routerinfo(void);
int router_nickname_matches(routerinfo_t *router, const char *nickname);
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index dfd58283c..86d11c09e 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -175,6 +175,13 @@ int all_directory_servers_down(void) {
return 1;
}
+/** Add all the friends of <b>router</b> to the smartlist <b>sl</b>.
+ */
+void routerlist_add_friends(smartlist_t *sl, routerinfo_t *router) {
+
+
+}
+
/** Given a comma-and-whitespace separated list of nicknames, see which
* nicknames in <b>list</b> name routers in our routerlist that are
* currently running. Add the routerinfos for those routers to <b>sl</b>.