summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-09-17 22:22:05 +0000
committerRoger Dingledine <arma@torproject.org>2007-09-17 22:22:05 +0000
commit8f75defd337961f221c939f3914c96b3b683e4cf (patch)
tree3a8336efbf8ff0610be389fb9d9e3ad4c0470271
parent9966a11b4dcbbaaa6b5fe5ebdd7b405a2c2042ab (diff)
downloadtor-8f75defd337961f221c939f3914c96b3b683e4cf.tar.gz
tor-8f75defd337961f221c939f3914c96b3b683e4cf.zip
Servers used to decline to publish their DirPort if their
BandwidthRate, RelayBandwidthRate, or MaxAdvertisedBandwidth were below a threshold. Now they only look at BandwidthRate and RelayBandwidthRate. svn:r11465
-rw-r--r--ChangeLog4
-rw-r--r--doc/TODO2
-rw-r--r--src/or/router.c5
-rw-r--r--src/or/test.c2
4 files changed, 9 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 82b4b7bd07..cb2a3e4e3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -42,6 +42,10 @@ Changes in version 0.2.0.7-alpha - 2007-??-??
- Don't try to access (or alter) the state file when running
--list-fingerprint or --verify-config or --hash-password. (Resolves
bug 499.)
+ - Servers used to decline to publish their DirPort if their
+ BandwidthRate, RelayBandwidthRate, or MaxAdvertisedBandwidth
+ were below a threshold. Now they only look at BandwidthRate and
+ RelayBandwidthRate.
o Code simplifications and refactoring:
- Revamp file-writing logic so we don't need to have the entire contents
diff --git a/doc/TODO b/doc/TODO
index 1254c2e17b..9bc07b7d83 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -36,8 +36,6 @@ Things we'd like to do in 0.2.0.x:
unreachable is bunk -- it's leftover from the time when all
servers ran 24/7. now it triggers every time a server goes
away and then returns before the old descriptor has expired.
- - maxadvertisedbandwidth should not influence whether dirport
- is published.
- 0.2.0.x dir authorities have stopped giving people Authority
flags.
- add a --quiet commandline option that suppresses logs. useful
diff --git a/src/or/router.c b/src/or/router.c
index 794f5473e1..9e85d77552 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -619,7 +619,10 @@ decide_to_advertise_dirport(or_options_t *options, routerinfo_t *router)
/* if we might potentially hibernate */
new_choice = 0;
reason = "AccountingMax enabled";
- } else if (router->bandwidthrate < 51200) {
+#define MIN_BW_TO_ADVERTISE_DIRPORT 51200
+ } else if (options->BandwidthRate < MIN_BW_TO_ADVERTISE_DIRPORT ||
+ (options->RelayBandwidthRate > 0 &&
+ options->RelayBandwidthRate < MIN_BW_TO_ADVERTISE_DIRPORT)) {
/* if we're advertising a small amount */
new_choice = 0;
reason = "BandwidthRate under 50KB";
diff --git a/src/or/test.c b/src/or/test.c
index bb673f953a..b420222d32 100644
--- a/src/or/test.c
+++ b/src/or/test.c
@@ -2163,7 +2163,7 @@ test_dir_format(void)
memset(buf, 0, 2048);
test_assert(router_dump_router_to_string(buf, 2048, &r1, pk2)>0);
- strlcpy(buf2, "router Magri 18.244.0.1 9000 0 0\n"
+ strlcpy(buf2, "router Magri 18.244.0.1 9000 0 9003\n"
"platform Tor "VERSION" on ", sizeof(buf2));
strlcat(buf2, get_uname(), sizeof(buf2));
strlcat(buf2, "\n"