summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-12-19 03:55:40 +0000
committerNick Mathewson <nickm@torproject.org>2007-12-19 03:55:40 +0000
commit95d500f33fc7e594f4d127e847dd5284e11d62ab (patch)
tree207c94438d65e756cd0409309e9063ebbf1948be
parent07c7f9e9e70125aca74e22b5c0bd9546d1b6314a (diff)
downloadtor-95d500f33fc7e594f4d127e847dd5284e11d62ab.tar.gz
tor-95d500f33fc7e594f4d127e847dd5284e11d62ab.zip
r15558@tombo: nickm | 2007-12-18 22:55:23 -0500
Re-parse annotations in another place. Good catch, arma. svn:r12868
-rw-r--r--doc/TODO2
-rw-r--r--src/or/routerlist.c11
2 files changed, 8 insertions, 5 deletions
diff --git a/doc/TODO b/doc/TODO
index 9cb9231207..db161d3840 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -42,6 +42,8 @@ R . spec
- Track consecutive time up, not time since last-forgotten IP.
o Add log lines.
o Tests
+ - Run a tweaked version on peacetime. Verify lack of kaboom.
+ - Write some basic unit tests.
- Mention in dir-spec.txt
- Mention in control-spec.txt
d let Vidalia use the geoip data too rather than doing its own
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 156285a47f..87cf78f61d 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -2506,18 +2506,19 @@ routerlist_replace(routerlist_t *rl, routerinfo_t *ri_old,
#endif
}
-/** DOCDOC -NM */
-/* XXX020 why are we dropping all router annotations here? -RD */
+/** Extract the descriptor <b>sd</b> from old_routerlist, and re-parse
+ * it as a fresh routerinfo_t. */
static routerinfo_t *
routerlist_reparse_old(routerlist_t *rl, signed_descriptor_t *sd)
{
routerinfo_t *ri;
const char *body;
- body = signed_descriptor_get_body(sd);
+ body = signed_descriptor_get_annotations(sd);
- ri = router_parse_entry_from_string(body, body+sd->signed_descriptor_len,
- 0, 0, NULL);
+ ri = router_parse_entry_from_string(body,
+ body+sd->signed_descriptor_len+sd->annotations_len,
+ 0, 1, NULL);
if (!ri)
return NULL;
memcpy(&ri->cache_info, sd, sizeof(signed_descriptor_t));