|
@@ -1399,7 +1399,9 @@ router_dump_router_to_string(char *s, size_t maxlen, routerinfo_t *router,
|
|
|
size_t written;
|
|
|
int result=0;
|
|
|
addr_policy_t *tmpe;
|
|
|
+#ifdef INCLUDE_BW_INFO_IN_ROUTERDESCS
|
|
|
char *bandwidth_usage;
|
|
|
+#endif
|
|
|
char *family_line;
|
|
|
or_options_t *options = get_options();
|
|
|
|
|
@@ -1434,8 +1436,10 @@ router_dump_router_to_string(char *s, size_t maxlen, routerinfo_t *router,
|
|
|
|
|
|
format_iso_time(published, router->cache_info.published_on);
|
|
|
|
|
|
+#ifdef INCLUDE_BW_INFO_IN_ROUTERDESCS
|
|
|
|
|
|
bandwidth_usage = rep_hist_get_bandwidth_lines(0);
|
|
|
+#endif
|
|
|
|
|
|
if (router->declared_family && smartlist_len(router->declared_family)) {
|
|
|
size_t n;
|
|
@@ -1477,12 +1481,19 @@ router_dump_router_to_string(char *s, size_t maxlen, routerinfo_t *router,
|
|
|
extra_info_digest,
|
|
|
options->DownloadExtraInfo ? "opt caches-extra-info\n" : "",
|
|
|
onion_pkey, identity_pkey,
|
|
|
- family_line, bandwidth_usage,
|
|
|
+ family_line,
|
|
|
+#ifdef INCLUDE_BW_INFO_IN_ROUTERDESCS
|
|
|
+ bandwidth_usage,
|
|
|
+#else
|
|
|
+ "",
|
|
|
+#endif
|
|
|
we_are_hibernating() ? "opt hibernating 1\n" : "");
|
|
|
tor_free(family_line);
|
|
|
tor_free(onion_pkey);
|
|
|
tor_free(identity_pkey);
|
|
|
+#ifdef INCLUDE_BW_INFO_IN_ROUTERDESCS
|
|
|
tor_free(bandwidth_usage);
|
|
|
+#endif
|
|
|
|
|
|
if (result < 0) {
|
|
|
log_warn(LD_BUG,"descriptor snprintf #1 ran out of room!");
|