diff options
author | Nick Mathewson <nickm@torproject.org> | 2003-05-06 17:38:16 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2003-05-06 17:38:16 +0000 |
commit | fcf7bfe290dde7d21785eac95809dee94e586217 (patch) | |
tree | fa3d6b68a5b28abb98b3367d8f93cf77c4600663 /src/or/onion.c | |
parent | 03ed54e920f16d726ca22f05d0d490fb6d8eed74 (diff) | |
download | tor-fcf7bfe290dde7d21785eac95809dee94e586217.tar tor-fcf7bfe290dde7d21785eac95809dee94e586217.tar.gz |
Refactor directories; add unit tests; add router keyword
svn:r266
Diffstat (limited to 'src/or/onion.c')
-rw-r--r-- | src/or/onion.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/onion.c b/src/or/onion.c index 915532468..db9acf5d0 100644 --- a/src/or/onion.c +++ b/src/or/onion.c @@ -347,6 +347,7 @@ crypt_path_t *onion_generate_cpath(routerinfo_t **firsthop) { int routelen; /* length of the route */ unsigned int *route; /* hops in the route as an array of indexes into rarray */ crypt_path_t *cpath=NULL; + directory_t *dir; routerinfo_t **rarray; int rarray_len; int i; @@ -354,7 +355,9 @@ crypt_path_t *onion_generate_cpath(routerinfo_t **firsthop) { routerinfo_t *router; struct in_addr netaddr; - router_get_rarray(&rarray, &rarray_len); + router_get_directory(&dir); + rarray = dir->routers; + rarray_len = dir->n_routers; /* choose a route */ route = new_route(options.CoinWeight, rarray, rarray_len, &routelen); |