summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-07-27 23:18:55 +0000
committerNick Mathewson <nickm@torproject.org>2007-07-27 23:18:55 +0000
commitf6229d6432ba2d15b5f018df8acb2b3e31379df0 (patch)
treed5f82a4103877ed99b070bbde6367d753f916197
parent51c734384a365c7d3111a310daf9425d6c5b0278 (diff)
downloadtor-f6229d6432ba2d15b5f018df8acb2b3e31379df0.tar.gz
tor-f6229d6432ba2d15b5f018df8acb2b3e31379df0.zip
r13950@catbus: nickm | 2007-07-27 18:15:23 -0400
Wrap bandwidth usage info in another ifdef so we can easily drop it on august 1 when it is time to finalize proposal 104. svn:r10951
-rw-r--r--src/or/or.h3
-rw-r--r--src/or/router.c13
2 files changed, 15 insertions, 1 deletions
diff --git a/src/or/or.h b/src/or/or.h
index d2f103ec74..4a466648b9 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -156,6 +156,9 @@
/** Undefine this when it's time to stop generating v1 directories. */
#define FULL_V1_DIRECTORIES
+/** Undefine this when it's time to stop includeing bandwidth info in router
+ * descriptors. */
+#define INCLUDE_BW_INFO_IN_ROUTERDESCS
/** Length of longest allowable configured nickname. */
#define MAX_NICKNAME_LEN 19
diff --git a/src/or/router.c b/src/or/router.c
index 22b3eb4e42..c54f11a20b 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -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,
/* Encode the publication time. */
format_iso_time(published, router->cache_info.published_on);
+#ifdef INCLUDE_BW_INFO_IN_ROUTERDESCS
/* How busy have we been? */
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!");