aboutsummaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2009-07-07 18:04:00 +0200
committerRoger Dingledine <arma@torproject.org>2009-07-27 23:53:06 -0400
commit3e454451045ae032f0e78e48f8f72c1592cc0658 (patch)
tree77389fabf0033bc96f7e7342977b0610f0e02471 /src/or/router.c
parenta73acdd46f946a18f678167f2f8083cac18ebe01 (diff)
downloadtor-3e454451045ae032f0e78e48f8f72c1592cc0658.tar
tor-3e454451045ae032f0e78e48f8f72c1592cc0658.tar.gz
Changing MaxAdvertisedBW may not need a republish
Relays no longer publish a new server descriptor if they change their MaxAdvertisedBandwidth config option but it doesn't end up changing their advertised bandwidth numbers. Bugfix on 0.2.0.28-rc; fixes bug 1026. Patch from Sebastian.
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 6f899854e..859a1e805 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -1300,18 +1300,10 @@ router_rebuild_descriptor(int force)
ri->platform = tor_strdup(platform);
/* compute ri->bandwidthrate as the min of various options */
- ri->bandwidthrate = (int)options->BandwidthRate;
- if (ri->bandwidthrate > options->MaxAdvertisedBandwidth)
- ri->bandwidthrate = (int)options->MaxAdvertisedBandwidth;
- if (options->RelayBandwidthRate > 0 &&
- ri->bandwidthrate > options->RelayBandwidthRate)
- ri->bandwidthrate = (int)options->RelayBandwidthRate;
+ ri->bandwidthrate = get_effective_bwrate(options);
/* and compute ri->bandwidthburst similarly */
- ri->bandwidthburst = (int)options->BandwidthBurst;
- if (options->RelayBandwidthBurst > 0 &&
- ri->bandwidthburst > options->RelayBandwidthBurst)
- ri->bandwidthburst = (int)options->RelayBandwidthBurst;
+ ri->bandwidthburst = get_effective_bwburst(options);
ri->bandwidthcapacity = hibernating ? 0 : rep_hist_bandwidth_assess();