]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Split uptime into separate field
authorNick Mathewson <nickm@torproject.org>
Tue, 20 Jul 2004 21:13:11 +0000 (21:13 +0000)
committerNick Mathewson <nickm@torproject.org>
Tue, 20 Jul 2004 21:13:11 +0000 (21:13 +0000)
svn:r2067

src/or/router.c
src/or/test.c

index 35562eff73aee88a15ba55de1720b0b17eeb0695..f9b413db06cbb00022b0349f86cca33a3e9139d1 100644 (file)
@@ -527,8 +527,8 @@ int router_rebuild_descriptor(void) {
  */
 void get_platform_str(char *platform, int len)
 {
-  snprintf(platform, len-1, "Tor %s (up %ld sec) on %s",
-           VERSION, stats_n_seconds_uptime, get_uname());
+  snprintf(platform, len-1, "Tor %s on %s",
+           VERSION, get_uname());
   platform[len-1] = '\0';
   return;
 }
@@ -591,6 +591,7 @@ int router_dump_router_to_string(char *s, int maxlen, routerinfo_t *router,
                     "router %s %s %d %d %d\n"
                     "platform %s\n"
                     "published %s\n"
+                    "opt uptime %ld\n"
                     "bandwidth %d %d %d\n"
                     "onion-key\n%s"
                     "signing-key\n%s",
@@ -604,6 +605,7 @@ int router_dump_router_to_string(char *s, int maxlen, routerinfo_t *router,
     router->is_trusted_dir ? router->dir_port : 0,
     router->platform,
     published,
+    stats_n_seconds_uptime,
     (int) router->bandwidthrate,
     (int) router->bandwidthburst,
     (int) router->advertisedbandwidth,
index 1acd13f183cdcc4a9347a9fd70c7e2d978d1db3b..95556c445286d336e3a57c49c70c15c335a94f53 100644 (file)
@@ -723,13 +723,14 @@ test_dir_format()
   test_assert(router_dump_router_to_string(buf, 2048, &r1, pk2)>0);
 
   strcpy(buf2, "router Magri testaddr1.foo.bar 9000 9002 9003\n"
-         "platform Tor "VERSION" (up 0 sec) on ");
-  /* XXX the "0" above is hardcoded, but even if we made it reflect
-   * uptime, that still wouldn't make it right, because the two
-   * descriptors might be made on different seconds... hm. */
+         "platform Tor "VERSION" on ");
   strcat(buf2, get_uname());
   strcat(buf2, "\n"
          "published 1970-01-01 00:00:00\n"
+         "opt uptime 0\n"
+  /* XXX the "0" above is hardcoded, but even if we made it reflect
+   * uptime, that still wouldn't make it right, because the two
+   * descriptors might be made on different seconds... hm. */
          "bandwidth 1000 5000 10000\n"
          "onion-key\n");
   strcat(buf2, pk1_str);