[or-cvs] r16544: {tor} Give bw in kb/sec in votes/consensus (in tor/trunk: doc/spec/proposals src/or)

weasel at seul.org weasel at seul.org
Thu Aug 14 12:37:59 UTC 2008


Author: weasel
Date: 2008-08-14 08:37:59 -0400 (Thu, 14 Aug 2008)
New Revision: 16544

Modified:
   tor/trunk/doc/spec/proposals/141-jit-sd-downloads.txt
   tor/trunk/src/or/dirserv.c
Log:
Give bw in kb/sec in votes/consensus

Modified: tor/trunk/doc/spec/proposals/141-jit-sd-downloads.txt
===================================================================
--- tor/trunk/doc/spec/proposals/141-jit-sd-downloads.txt	2008-08-14 12:37:50 UTC (rev 16543)
+++ tor/trunk/doc/spec/proposals/141-jit-sd-downloads.txt	2008-08-14 12:37:59 UTC (rev 16544)
@@ -119,15 +119,18 @@
   to the "r", "s", and "v" lines that already exist.  This line
   will convey weight information to clients.
 
-   "w Bandwidth=193671"
+   "w Bandwidth=193"
 
   The bandwidth number is the lesser of observed bandwidth and bandwidth
   rate limit from the server descriptor that the "r" line referenced by
   digest (1st and 3rd field of the bandwidth line in the descriptor).
+  It is given in kilobytes per second so the byte value in the
+  descriptor has to be divided by 1024 (and is then truncated, i.e.
+  rounded down).
 
   Authorities will cap the bandwidth number at some arbitrary value,
   currently 10MB/sec.  If a router claims a larger bandwidth an
-  authority's vote will still only show Bandwidth=10000000.
+  authority's vote will still only show Bandwidth=10240.
 
   The consensus value for bandwidth is the median of all bandwidth
   numbers given in votes.  In case of an even number of votes we use

Modified: tor/trunk/src/or/dirserv.c
===================================================================
--- tor/trunk/src/or/dirserv.c	2008-08-14 12:37:50 UTC (rev 16543)
+++ tor/trunk/src/or/dirserv.c	2008-08-14 12:37:59 UTC (rev 16544)
@@ -1966,7 +1966,7 @@
 
     r = tor_snprintf(cp, buf_len - (cp-buf),
                      "w Bandwidth=%d\n",
-                     router_get_advertised_bandwidth_capped(desc));
+                     router_get_advertised_bandwidth_capped(desc) / 1024);
     if (r<0) {
       log_warn(LD_BUG, "Not enough space in buffer.");
       return -1;



More information about the tor-commits mailing list