Commit c62da5cf authored by George Kadianakis's avatar George Kadianakis Committed by Nick Mathewson
Browse files

Improve code based on Nick review:

- Fix some more crazy ternary ops.
- Fix the order of disaster SRV computation.
- Whitespace fixes.
- Remove a redundant warn.
- Better docs.
parent 4ad4467f
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -699,8 +699,11 @@ hs_circ_retry_service_rendezvous_point(origin_circuit_t *circ)
  circ->hs_service_side_rend_circ_has_been_relaunched = 1;

  /* Legacy service don't have an hidden service ident. */
  (circ->hs_ident) ? retry_service_rendezvous_point(circ) :
  if (circ->hs_ident) {
    retry_service_rendezvous_point(circ);
  } else {
    rend_service_relaunch_rendezvous(circ);
  }

 done:
  return;
+2 −2
Original line number Diff line number Diff line
@@ -521,9 +521,9 @@ get_disaster_srv(uint64_t time_period_num, uint8_t *srv_out)
    uint64_t time_period_length = get_time_period_length();
    char period_stuff[sizeof(uint64_t)*2];
    size_t offset = 0;
    set_uint64(period_stuff, tor_htonll(time_period_num));
    set_uint64(period_stuff, tor_htonll(time_period_length));
    offset += sizeof(uint64_t);
    set_uint64(period_stuff+offset, tor_htonll(time_period_length));
    set_uint64(period_stuff+offset, tor_htonll(time_period_num));
    offset += sizeof(uint64_t);
    tor_assert(offset == sizeof(period_stuff));

+0 −1
Original line number Diff line number Diff line
@@ -1007,7 +1007,6 @@ desc_encode_v3(const hs_descriptor_t *desc,
  tor_assert(desc->plaintext_data.version == 3);

  if (BUG(desc->subcredential == NULL)) {
    log_warn(LD_GENERAL, "Asked to encode desc with no subcred. No!");
    goto err;
  }

+1 −1
Original line number Diff line number Diff line
@@ -1400,7 +1400,7 @@ networkstatus_get_live_consensus,(time_t now))
    return NULL;
}

/** Given a consensus in <b>ns</b>, validate that it's currently live and
/** Given a consensus in <b>ns</b>, return true iff currently live and
 *  unexpired. */
int
networkstatus_is_live(const networkstatus_t *ns, time_t now)
+2 −2

File changed.

Contains only whitespace changes.