should_generate_v2_networkstatus(void)
{
return authdir_mode_v2(get_options()) &&
- !authdir_mode_bridge(get_options()) && /* XXX020 */
+ !authdir_mode_bridge(get_options()) && /* XXX020 RD */
the_v2_networkstatus_is_dirty &&
the_v2_networkstatus_is_dirty + DIR_REGEN_SLACK_TIME < time(NULL);
}
tor_malloc(sizeof(uint32_t)*smartlist_len(rl->routers));
mtbfs = tor_malloc(sizeof(double)*smartlist_len(rl->routers));
- /* XXXX020 we should just use arrays and qsort. */
SMARTLIST_FOREACH(rl->routers, routerinfo_t *, ri, {
if (router_is_active(ri, now)) {
const char *id = ri->cache_info.identity_digest;
router_is_active(ri, now) &&
!dirserv_thinks_router_is_unreliable(now, ri, 0, 1);
rs->is_running = ri->is_running; /* computed above */
- /*
- int f_authority = router_digest_is_trusted_dir(
- ri->cache_info.identity_digest);
- */
rs->is_named = naming && ri->is_named;
rs->is_valid = ri->is_valid;
rs->is_possible_guard = rs->is_fast && rs->is_stable &&
vote_timing_t timing;
digestmap_t *omit_as_sybil = NULL;
- /* check that everything is deallocated XXXX020 */
-
tor_assert(private_key);
tor_assert(cert);
v3_out->voters = smartlist_create();
smartlist_add(v3_out->voters, voter);
v3_out->cert = authority_cert_dup(cert);
- /* ????? networkstatus_digest is unset. */
v3_out->routerstatus_list = routerstatuses;
+ /* Note: networkstatus_digest is unset; it won't get set until we actually
+ * format the vote. */
return v3_out;
}
(LONGEST_STATUS_FLAG_NAME_LEN+1)*N_STATUS_FLAGS + 2)
size_t len;
- char *status = NULL, *client_versions = NULL, *server_versions = NULL;
+ char *status = NULL;
+ const char *client_versions = NULL, *server_versions = NULL;
char *outp, *endp;
- // or_options_t *options = get_options();
char fingerprint[FINGERPRINT_LEN+1];
char ipaddr[INET_NTOA_BUF_LEN];
char digest[DIGEST_LEN];
struct in_addr in;
uint32_t addr;
routerlist_t *rl = router_get_routerlist();
- // time_t now = time(NULL);
- // time_t cutoff = now - ROUTER_MAX_AGE_TO_PUBLISH;
- /*
- int naming = options->NamingAuthoritativeDir;
- int listbadexits = options->AuthDirListBadExits;
- int exits_can_be_guards;
- */
char *version_lines = NULL;
networkstatus_voter_info_t *voter;
- /* XXX020 check that everything gets freed */
tor_assert(private_signing_key);
* <b>conn</b>, and the outbuf has become too empty. If the current
* networkstatus object (in <b>conn</b>-\>cached_dir) has more data, pull data
* from there. Otherwise, pop the next fingerprint from fingerprint_stack,
- * and start spooling the next networkstatus. If we run out of entries,
+ * and start spooling the next networkstatus. (A digest of all 0 bytes is
+ * treated as a request for the current consensus.) If we run out of entries,
* flushes the zlib state and sets the spool source to NONE. Returns 0 on
* success, negative on failure. */
static int
/* Add another networkstatus; start serving it. */
char *fp = smartlist_pop_last(conn->fingerprint_stack);
cached_dir_t *d;
- if (tor_digest_is_zero(fp)) /* XXXX020 document this "feature". */
+ if (tor_digest_is_zero(fp))
d = cached_v3_networkstatus;
else if (router_digest_is_me(fp))
d = the_v2_networkstatus;