[or-cvs] r12868: Re-parse annotations in another place. Good catch, arma. (in tor/trunk: . doc src/or)

nickm at seul.org nickm at seul.org
Wed Dec 19 03:55:40 UTC 2007


Author: nickm
Date: 2007-12-18 22:55:40 -0500 (Tue, 18 Dec 2007)
New Revision: 12868

Modified:
   tor/trunk/
   tor/trunk/doc/TODO
   tor/trunk/src/or/routerlist.c
Log:
 r15558 at tombo:  nickm | 2007-12-18 22:55:23 -0500
 Re-parse annotations in another place.  Good catch, arma.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r15558] on d9e39d38-0f13-419c-a857-e10a0ce2aa0c

Modified: tor/trunk/doc/TODO
===================================================================
--- tor/trunk/doc/TODO	2007-12-19 03:11:02 UTC (rev 12867)
+++ tor/trunk/doc/TODO	2007-12-19 03:55:40 UTC (rev 12868)
@@ -42,6 +42,8 @@
       - 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

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2007-12-19 03:11:02 UTC (rev 12867)
+++ tor/trunk/src/or/routerlist.c	2007-12-19 03:55:40 UTC (rev 12868)
@@ -2506,18 +2506,19 @@
 #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));



More information about the tor-commits mailing list