aboutsummaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-06-25 00:29:31 +0000
committerNick Mathewson <nickm@torproject.org>2004-06-25 00:29:31 +0000
commit76f769deb9dab9e68cb2dd49c6a5a852f2ca2cd7 (patch)
tree8b833310f12954d9ebf61d267c61f87c7481afbf /src/or/directory.c
parente9b882554e44641011e3ee5be26e7cc200f3dd71 (diff)
downloadtor-76f769deb9dab9e68cb2dd49c6a5a852f2ca2cd7.tar.gz
tor-76f769deb9dab9e68cb2dd49c6a5a852f2ca2cd7.zip
Remaining 008pre1 items done; deferred where more design is needed.
More docs and (way more!) testing needed. Done: - Authdirservers down directories from others. - Generate and use running-routers lists - Cache directories; store across reboots. - Refactor directory parsing a bit; note potential trouble spots. svn:r1985
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 3f8b3a94cc..61c98df4c0 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -352,6 +352,8 @@ int connection_dir_process_inbuf(connection_t *conn) {
}
if(conn->purpose == DIR_PURPOSE_FETCH_RUNNING_LIST) {
+ running_routers_t *rrs;
+ routerlist_t *rl;
/* just update our list of running routers, if this list is new info */
log_fn(LOG_INFO,"Received running-routers list (size %d):\n%s", body_len, body);
if(status_code != 200) {
@@ -361,7 +363,15 @@ int connection_dir_process_inbuf(connection_t *conn) {
connection_mark_for_close(conn);
return -1;
}
- /* XXX008 hand 'body' to something that parses a running-routers list. */
+ if (!(rrs = router_parse_runningrouters(body))) {
+ log_fn(LOG_WARN, "Can't parse runningrouters list");
+ free(body); free(headers);
+ connection_mark_for_close(conn);
+ return -1;
+ }
+ router_get_routerlist(&rl);
+ routerlist_update_from_runningrouters(rl,rrs);
+ running_routers_free(rrs);
}
if(conn->purpose == DIR_PURPOSE_UPLOAD_DIR) {