smartlist_free(responsible_dirs);
return;
}
- tor_assert(smartlist_len(responsible_dirs) ==
- REND_NUMBER_OF_CONSECUTIVE_REPLICAS);
- for (j = 0; j < REND_NUMBER_OF_CONSECUTIVE_REPLICAS; j++) {
+ for (j = 0; j < smartlist_len(responsible_dirs); j++) {
char desc_id_base32[REND_DESC_ID_V2_LEN_BASE32 + 1];
hs_dir = smartlist_get(responsible_dirs, j);
/* Send publish request. */
const char *esc_router_info(routerinfo_t *router);
void routers_sort_by_identity(smartlist_t *routers);
+#if 0
int hid_serv_have_enough_directories(void);
+#endif
int hid_serv_get_responsible_directories(smartlist_t *responsible_dirs,
const char *id);
#if 0
/* Upload v2 descriptor? */
if (service->descriptor_version == 2 &&
get_options()->PublishHidServDescriptors) {
- if (hid_serv_have_enough_directories()) {
+ networkstatus_vote_t *c = networkstatus_get_latest_consensus();
+ if (c && smartlist_len(c->routerstatus_list) > 0) {
int seconds_valid;
smartlist_t *descs = smartlist_create();
int i;
}
#endif
+#if 0
/** Return true, if we are aware of enough hidden service directory to
* usefully perform v2 rend operations on them (publish, fetch, replicate),
* or false otherwise. */
});
return 0;
}
+#endif
-/** Determine the REND_NUMBER_OF_CONSECUTIVE_REPLICAS routers that are
- * responsible for <b>id</b> (binary) and add pointers to those routers'
- * routerstatus_t to <b>responsible_dirs</b>. If we don't have enough
- * hidden service directories, return -1, else 0. */
+/** Determine the routers that are responsible for <b>id</b> (binary) and
+ * add pointers to those routers' routerstatus_t to <b>responsible_dirs</b>.
+ * If we don't have a consensus, return -1, else 0. */
int
hid_serv_get_responsible_directories(smartlist_t *responsible_dirs,
const char *id)
i = 0;
} while (i != start);
- /* XXX020 make this louder once we have some v2hidservs */
- log_info(LD_REND, "We don't have enough hidden service directories to "
- "perform v2 rendezvous operations!");
- return -1;
+ /* Even though we don't have the desired number of hidden service
+ * directories, we are happy with what we got. */
+ return 0;
}
/** Return true if this node is currently acting as hidden service