[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r10951: Wrap bandwidth usage info in another ifdef so we can easily (in tor/trunk: . src/or)



Author: nickm
Date: 2007-07-27 19:18:55 -0400 (Fri, 27 Jul 2007)
New Revision: 10951

Modified:
   tor/trunk/
   tor/trunk/src/or/or.h
   tor/trunk/src/or/router.c
Log:
 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.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r13950] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2007-07-27 22:09:08 UTC (rev 10950)
+++ tor/trunk/src/or/or.h	2007-07-27 23:18:55 UTC (rev 10951)
@@ -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

Modified: tor/trunk/src/or/router.c
===================================================================
--- tor/trunk/src/or/router.c	2007-07-27 22:09:08 UTC (rev 10950)
+++ tor/trunk/src/or/router.c	2007-07-27 23:18:55 UTC (rev 10951)
@@ -1399,7 +1399,9 @@
   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 @@
   /* 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 @@
     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!");