Commit d6c89b1a authored by Nick Mathewson's avatar Nick Mathewson 🦀
Browse files

Make networkstatus_getinfo_by_purpose report published_on again.

When we implemented prop275 in 0.4.8.1-alpha, we changed the
behavior of networkstatus_getinfo_helper_single to omit meaningful
published_on times, replacing them with "2038-01-01".  This is
necessary when we're formatting a routerstatus with no additional
info, since routerstatus objects no longer include a published_on.

But in networkstatus_getinfo_by_purpose, we do have a routerinfo
that does have a published_on.  This patch uses that information
to report published_on times in our output when we're making a
"virtual" networkstatus for a big file of routerinfo_t objects.
This is mostly important for bridge authorities, since when
they dump a secret list of the bridges, they want to include
published_on times.

Closes #40855. Bugfix on 0.4.8.1-alpha.
parent 89148fbf
Loading
Loading
Loading
Loading

changes/bug40855

0 → 100644
+6 −0
Original line number Diff line number Diff line
  o Minor bugfixes (bridge authority):
    - When reporting a pseudo-networkstatus as a bridge authority,
      or answering "ns/purpose/*" controller requests,
      include accurate published-on dates from our
      list of router descriptors.  Fixes bug 40855;
      bugfix on 0.4.8.1-alpha.
+3 −1
Original line number Diff line number Diff line
@@ -2451,7 +2451,9 @@ networkstatus_getinfo_by_purpose(const char *purpose_string, time_t now)
    if (ri->purpose != purpose)
      continue;
    set_routerstatus_from_routerinfo(&rs, node, ri);
    smartlist_add(statuses, networkstatus_getinfo_helper_single(&rs));
    char *text = routerstatus_format_entry(
      &rs, NULL, NULL, NS_CONTROL_PORT, NULL, ri->cache_info.published_on);
    smartlist_add(statuses, text);
  } SMARTLIST_FOREACH_END(ri);

  answer = smartlist_join_strings(statuses, "", 0, NULL);