]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
move the clause above the "if bw is too low" check
authorRoger Dingledine <arma@torproject.org>
Tue, 8 Feb 2011 04:22:45 +0000 (23:22 -0500)
committerRoger Dingledine <arma@torproject.org>
Tue, 8 Feb 2011 04:22:45 +0000 (23:22 -0500)
src/or/config.c

index 8066a23a4a57ab26754e4fd06b4f9eb33934c76f..a955b1728bca45fe7de56b7f00131e8aba90b575 100644 (file)
@@ -3368,6 +3368,11 @@ options_validate(or_options_t *old_options, or_options_t *options,
                            "RelayBandwidthBurst", 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),
@@ -3399,11 +3404,6 @@ options_validate(or_options_t *old_options, or_options_t *options,
     }
   }
 
-  if (options->RelayBandwidthRate && !options->RelayBandwidthBurst)
-    options->RelayBandwidthBurst = options->RelayBandwidthRate;
-  if (options->RelayBandwidthBurst && !options->RelayBandwidthRate)
-    options->RelayBandwidthRate = options->RelayBandwidthBurst;
-
   if (options->RelayBandwidthRate > options->RelayBandwidthBurst)
     REJECT("RelayBandwidthBurst must be at least equal "
            "to RelayBandwidthRate.");