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

[or-cvs] r11465: Servers used to decline to publish their DirPort if their Ba (in tor/trunk: . doc src/or)



Author: arma
Date: 2007-09-17 18:22:05 -0400 (Mon, 17 Sep 2007)
New Revision: 11465

Modified:
   tor/trunk/ChangeLog
   tor/trunk/doc/TODO
   tor/trunk/src/or/router.c
   tor/trunk/src/or/test.c
Log:
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.


Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-09-17 21:59:24 UTC (rev 11464)
+++ tor/trunk/ChangeLog	2007-09-17 22:22:05 UTC (rev 11465)
@@ -42,6 +42,10 @@
     - 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

Modified: tor/trunk/doc/TODO
===================================================================
--- tor/trunk/doc/TODO	2007-09-17 21:59:24 UTC (rev 11464)
+++ tor/trunk/doc/TODO	2007-09-17 22:22:05 UTC (rev 11465)
@@ -36,8 +36,6 @@
           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

Modified: tor/trunk/src/or/router.c
===================================================================
--- tor/trunk/src/or/router.c	2007-09-17 21:59:24 UTC (rev 11464)
+++ tor/trunk/src/or/router.c	2007-09-17 22:22:05 UTC (rev 11465)
@@ -619,7 +619,10 @@
     /* 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";

Modified: tor/trunk/src/or/test.c
===================================================================
--- tor/trunk/src/or/test.c	2007-09-17 21:59:24 UTC (rev 11464)
+++ tor/trunk/src/or/test.c	2007-09-17 22:22:05 UTC (rev 11465)
@@ -2163,7 +2163,7 @@
   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"