]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2
authorNick Mathewson <nickm@torproject.org>
Tue, 8 Feb 2011 19:37:02 +0000 (14:37 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 8 Feb 2011 19:37:02 +0000 (14:37 -0500)
1  2 
src/or/config.c

diff --cc src/or/config.c
index 5aca2256ff68e626f10e336b4ac395e9caed9c65,a955b1728bca45fe7de56b7f00131e8aba90b575..eae92b24086897a9e7a6bd299ecd39f678f4e7a9
@@@ -3338,16 -3367,15 +3338,21 @@@ options_validate(or_options_t *old_opti
    if (ensure_bandwidth_cap(&options->RelayBandwidthBurst,
                             "RelayBandwidthBurst", msg) < 0)
      return -1;
 +  if (ensure_bandwidth_cap(&options->PerConnBWRate,
 +                           "PerConnBWRate", msg) < 0)
 +    return -1;
 +  if (ensure_bandwidth_cap(&options->PerConnBWBurst,
 +                           "PerConnBWBurst", msg) < 0)
 +    return -1;
  
+   if (options->RelayBandwidthRate && !options->RelayBandwidthBurst)
+     options->RelayBandwidthBurst = options->RelayBandwidthRate;
+   if (options->RelayBandwidthBurst && !options->RelayBandwidthRate)
+     options->RelayBandwidthRate = options->RelayBandwidthBurst;
    if (server_mode(options)) {
      if (options->BandwidthRate < ROUTER_REQUIRED_MIN_BANDWIDTH) {
 -      r = tor_snprintf(buf, sizeof(buf),
 +      tor_asprintf(msg,
                         "BandwidthRate is set to %d bytes/second. "
                         "For servers, it must be at least %d.",
                         (int)options->BandwidthRate,