diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-01-12 18:04:17 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-01-12 18:04:17 +0000 |
commit | 2dd566d5d589ca8e758e28d1ffb961b7d4975571 (patch) | |
tree | d325912376183d50d3ab1f27c5c4d66806337619 /src/or/control.c | |
parent | 1f7ee33d1c30bf98181b48ebda26d0181994a08a (diff) | |
download | tor-2dd566d5d589ca8e758e28d1ffb961b7d4975571.tar.gz tor-2dd566d5d589ca8e758e28d1ffb961b7d4975571.zip |
Indirect access to the signed_descriptor field to make it easier to keep them lazily on disk.
svn:r5827
Diffstat (limited to 'src/or/control.c')
-rw-r--r-- | src/or/control.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/or/control.c b/src/or/control.c index 6e3cd42c67..72822dbf20 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -1279,20 +1279,27 @@ handle_getinfo_helper(const char *question, char **answer) *answer = list_getinfo_options(); } else if (!strcmpstart(question, "desc/id/")) { routerinfo_t *ri = router_get_by_hexdigest(question+strlen("desc/id/")); - if (ri && ri->cache_info.signed_descriptor) - *answer = tor_strdup(ri->cache_info.signed_descriptor); + if (ri) { + const char *body = signed_descriptor_get_body(&ri->cache_info); + if (body) + *answer = tor_strdup(body); + } } else if (!strcmpstart(question, "desc/name/")) { routerinfo_t *ri = router_get_by_nickname(question+strlen("desc/name/"),1); - if (ri && ri->cache_info.signed_descriptor) - *answer = tor_strdup(ri->cache_info.signed_descriptor); + if (ri) { + const char *body = signed_descriptor_get_body(&ri->cache_info); + if (body) + *answer = tor_strdup(body); + } } else if (!strcmp(question, "desc/all-recent")) { routerlist_t *routerlist = router_get_routerlist(); smartlist_t *sl = smartlist_create(); if (routerlist && routerlist->routers) { SMARTLIST_FOREACH(routerlist->routers, routerinfo_t *, ri, { - if (ri && ri->cache_info.signed_descriptor) - smartlist_add(sl, tor_strdup(ri->cache_info.signed_descriptor)); + const char *body = signed_descriptor_get_body(&ri->cache_info); + if (body) + smartlist_add(sl, tor_strdup(body)); }); } *answer = smartlist_join_strings(sl, "", 0, NULL); |