[or-cvs] r11434: Complete implementation of proposal 104: remove bandwidth hi (in tor/trunk: . doc src/or)
nickm at seul.org
nickm at seul.org
Wed Sep 12 17:33:23 UTC 2007
Author: nickm
Date: 2007-09-12 13:33:23 -0400 (Wed, 12 Sep 2007)
New Revision: 11434
Modified:
tor/trunk/
tor/trunk/ChangeLog
tor/trunk/doc/TODO
tor/trunk/src/or/router.c
tor/trunk/src/or/test.c
Log:
r14392 at Kushana: nickm | 2007-09-12 11:04:20 -0400
Complete implementation of proposal 104: remove bandwidth history lines from router descriptors.
Property changes on: tor/trunk
___________________________________________________________________
svk:merge ticket from /tor/trunk [r14392] on c95137ef-5f19-0410-b913-86e773d04f59
Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog 2007-09-12 17:33:18 UTC (rev 11433)
+++ tor/trunk/ChangeLog 2007-09-12 17:33:23 UTC (rev 11434)
@@ -15,6 +15,13 @@
- Accept LF instead of CRLF on controller, since some software has a
hard time generating real Internet newlines.
+ o Removed features:
+ - Routers no longer include bandwidth-history lines in their
+ descriptors; this information is already available in extra-info
+ documents, and including it in router descriptors took up 60% (!) of
+ compressed router descriptor downloads. Completes implementation of
+ proposal 104.
+
o Major bugfixes:
- Fix possible segfaults in functions called from
rend_process_relay_cell().
Modified: tor/trunk/doc/TODO
===================================================================
--- tor/trunk/doc/TODO 2007-09-12 17:33:18 UTC (rev 11433)
+++ tor/trunk/doc/TODO 2007-09-12 17:33:23 UTC (rev 11434)
@@ -78,8 +78,8 @@
- Controller support
- GETINFO to get consensus
- Event when new consensus arrives
- . 104: Long and Short Router Descriptors
- - Drop bandwidth history from router-descriptors around September 10,
+ o 104: Long and Short Router Descriptors
+ o Drop bandwidth history from router-descriptors around September 10,
once torstatus and weasel have upgraded.
- 105: Version negotiation for the Tor protocol
. 111: Prioritize local traffic over relayed.
Modified: tor/trunk/src/or/router.c
===================================================================
--- tor/trunk/src/or/router.c 2007-09-12 17:33:18 UTC (rev 11433)
+++ tor/trunk/src/or/router.c 2007-09-12 17:33:23 UTC (rev 11434)
@@ -1470,9 +1470,6 @@
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();
@@ -1507,11 +1504,6 @@
/* 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;
char *family = smartlist_join_strings(router->declared_family, " ", 0, &n);
@@ -1537,7 +1529,7 @@
"opt extra-info-digest %s\n%s"
"onion-key\n%s"
"signing-key\n%s"
- "%s%s%s",
+ "%s%s",
router->nickname,
router->address,
router->or_port,
@@ -1553,18 +1545,10 @@
options->DownloadExtraInfo ? "opt caches-extra-info\n" : "",
onion_pkey, identity_pkey,
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!");
Modified: tor/trunk/src/or/test.c
===================================================================
--- tor/trunk/src/or/test.c 2007-09-12 17:33:18 UTC (rev 11433)
+++ tor/trunk/src/or/test.c 2007-09-12 17:33:23 UTC (rev 11434)
@@ -2067,7 +2067,6 @@
addr_policy_t ex1, ex2;
routerlist_t *dir1 = NULL, *dir2 = NULL;
tor_version_t ver1;
- char *bw_lines = NULL;
pk1 = pk_generate(0);
pk2 = pk_generate(1);
@@ -2154,10 +2153,6 @@
r2.exit_policy = &ex1;
r2.nickname = tor_strdup("Fred");
- bw_lines = rep_hist_get_bandwidth_lines(0);
- test_assert(bw_lines);
- test_assert(!strcmpstart(bw_lines, "opt write-history "));
-
test_assert(!crypto_pk_write_public_key_to_string(pk1, &pk1_str,
&pk1_str_len));
test_assert(!crypto_pk_write_public_key_to_string(pk2 , &pk2_str,
@@ -2186,13 +2181,11 @@
strlcat(buf2, pk1_str, sizeof(buf2));
strlcat(buf2, "signing-key\n", sizeof(buf2));
strlcat(buf2, pk2_str, sizeof(buf2));
- strlcat(buf2, bw_lines, sizeof(buf2));
strlcat(buf2, "router-signature\n", sizeof(buf2));
buf[strlen(buf2)] = '\0'; /* Don't compare the sig; it's never the same
* twice */
test_streq(buf, buf2);
- tor_free(bw_lines);
test_assert(router_dump_router_to_string(buf, 2048, &r1, pk2)>0);
cp = buf;
More information about the tor-commits
mailing list