Commit 4556f2e7 authored by Sebastian Hahn's avatar Sebastian Hahn
Browse files

Rename router_get_by_digest()

We now call the function router_get_by_id_digest() to make clear that
we're talking about the identity digest here, not descriptor digest.
parent 376939c9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -622,7 +622,7 @@ command_process_netinfo_cell(cell_t *cell, or_connection_t *conn)
  /** Warn when we get a netinfo skew with at least this value. */
#define NETINFO_NOTICE_SKEW 3600
  if (labs(apparent_skew) > NETINFO_NOTICE_SKEW &&
      router_get_by_digest(conn->identity_digest)) {
      router_get_by_id_digest(conn->identity_digest)) {
    char dbuf[64];
    int severity;
    /*XXXX be smarter about when everybody says we are skewed. */
+2 −2
Original line number Diff line number Diff line
@@ -360,7 +360,7 @@ connection_or_digest_is_known_relay(const char *id_digest)
{
  if (router_get_consensus_status_by_id(id_digest))
    return 1; /* It's in the consensus: "yes" */
  if (router_get_by_digest(id_digest))
  if (router_get_by_id_digest(id_digest))
    return 1; /* Not in the consensus, but we have a descriptor for
               * it. Probably it was in a recent consensus. "Yes". */
  return 0;
@@ -1342,7 +1342,7 @@ connection_or_set_state_open(or_connection_t *conn)
    router_set_status(conn->identity_digest, 1);
  } else {
    /* only report it to the geoip module if it's not a known router */
    if (!router_get_by_digest(conn->identity_digest)) {
    if (!router_get_by_id_digest(conn->identity_digest)) {
      if (tor_addr_family(&TO_CONN(conn)->addr) == AF_INET) {
        /*XXXX IP6 support ipv6 geoip.*/
        uint32_t a = tor_addr_to_ipv4h(&TO_CONN(conn)->addr);
+4 −4
Original line number Diff line number Diff line
@@ -780,7 +780,7 @@ dirserv_add_extrainfo(extrainfo_t *ei, const char **msg)
  tor_assert(msg);
  *msg = NULL;

  ri = router_get_by_digest(ei->cache_info.identity_digest);
  ri = router_get_by_id_digest(ei->cache_info.identity_digest);
  if (!ri) {
    *msg = "No corresponding router descriptor for extra-info descriptor";
    extrainfo_free(ei);
@@ -2057,7 +2057,7 @@ routerstatus_format_entry(char *buf, size_t buf_len,
  }

  if (format != NS_V2) {
    const routerinfo_t* desc = router_get_by_digest(rs->identity_digest);
    const routerinfo_t* desc = router_get_by_id_digest(rs->identity_digest);
    uint32_t bw;

    if (format != NS_CONTROL_PORT) {
@@ -3099,7 +3099,7 @@ dirserv_get_routerdescs(smartlist_t *descs_out, const char *key,
           if (ri)
             smartlist_add(descs_out, (void*) &(ri->cache_info));
         } else {
           const routerinfo_t *ri = router_get_by_digest(d);
           const routerinfo_t *ri = router_get_by_id_digest(d);
           /* Don't actually serve a descriptor that everyone will think is
            * expired.  This is an (ugly) workaround to keep buggy 0.1.1.10
            * Tors from downloading descriptors that they will throw away.
@@ -3299,7 +3299,7 @@ get_signed_descriptor_by_fp(const char *fp, int extrainfo,
    else
      return &(router_get_my_routerinfo()->cache_info);
  } else {
    const routerinfo_t *ri = router_get_by_digest(fp);
    const routerinfo_t *ri = router_get_by_id_digest(fp);
    if (ri &&
        ri->cache_info.published_on > publish_cutoff) {
      if (extrainfo)
+1 −1
Original line number Diff line number Diff line
@@ -415,7 +415,7 @@ directory_get_from_hs_dir(const char *desc_id, const rend_data_t *rend_query)
  SMARTLIST_FOREACH(responsible_dirs, routerstatus_t *, dir, {
    if (lookup_last_hid_serv_request(dir, desc_id_base32, 0, 0) +
            REND_HID_SERV_DIR_REQUERY_PERIOD >= now ||
        !router_get_by_digest(dir->identity_digest))
        !router_get_by_id_digest(dir->identity_digest))
      SMARTLIST_DEL_CURRENT(responsible_dirs, dir);
  });

+1 −1
Original line number Diff line number Diff line
@@ -1578,7 +1578,7 @@ directory_post_to_hs_dir(rend_service_descriptor_t *renddesc,
                                hs_dir->identity_digest))
        /* Don't upload descriptor if we succeeded in doing so last time. */
        continue;
      if (!router_get_by_digest(hs_dir->identity_digest)) {
      if (!router_get_by_id_digest(hs_dir->identity_digest)) {
        log_info(LD_REND, "Not sending publish request for v2 descriptor to "
                          "hidden service directory '%s'; we don't have its "
                          "router descriptor. Queuing for later upload.",
Loading