diff options
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/or/config.c b/src/or/config.c index 580771d759..9fbd357b3a 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -217,15 +217,7 @@ get_options(void) { } /** Change the current global options to contain <b>new_val</b> instead - * of their current value; free the old value as necessary. Where - * <b>new_val</b> is different from the old value, update the process to - * use the new value instead. - * - * Note 1: <b>new_val</b> must have previously been validated with - * options_validate(), or Tor may freak out and exit. - * - * Note 2: We haven't moved all the "act on new configuration" logic - * here yet. Some is still in do_hup() and other places. + * of their current value; free the old value as necessary. */ void set_options(or_options_t *new_val) { @@ -237,6 +229,12 @@ set_options(or_options_t *new_val) { /** Fetch the active option list, and take actions based on it. All * of the things we do should survive being done repeatedly. * Return 0 if all goes well, return -1 if it's time to die. + * + * Note 1: <b>new_val</b> must have previously been validated with + * options_validate(), or Tor may freak out and exit. + * + * Note 2: We haven't moved all the "act on new configuration" logic + * here yet. Some is still in do_hup() and other places. */ int options_act(void) { @@ -1369,6 +1367,10 @@ options_validate(or_options_t *options) log(LOG_WARN,"BandwidthBurst must be less than %d",INT_MAX); result = -1; } + if (options->BandwidthRate < ROUTER_REQUIRED_MIN_BANDWIDTH) { + log(LOG_WARN,"BandwidthRate is set to %d bytes/second. It must be at least %d.", (int)options->BandwidthRate, ROUTER_REQUIRED_MIN_BANDWIDTH); + result = -1; + } if (options->_MonthlyAccountingStart) { if (options->AccountingStart) { |