From 3308f8d09f5518c5f4654f5fe4b35d62eeee6642 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 2 Aug 2013 10:57:01 +0200 Subject: [PATCH 1/1] tor.cgi: Burst bandwidth may never be less than rate. --- html/cgi-bin/tor.cgi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/html/cgi-bin/tor.cgi b/html/cgi-bin/tor.cgi index dca5fda14..0c5477fd6 100644 --- a/html/cgi-bin/tor.cgi +++ b/html/cgi-bin/tor.cgi @@ -116,6 +116,14 @@ if ($settings{'ACTION'} eq $Lang::tr{'save'}) { } } + # Burst bandwidth must be less or equal to bandwidth rate. + if ($settings{'TOR_RELAY_BANDWIDTH_RATE'} == 0) { + $settings{'TOR_RELAY_BANDWIDTH_BURST'} = 0; + + } elsif ($settings{'TOR_RELAY_BANDWIDTH_BURST'} < $settings{'TOR_RELAY_BANDWIDTH_RATE'}) { + $settings{'TOR_RELAY_BANDWIDTH_BURST'} = $settings{'TOR_RELAY_BANDWIDTH_RATE'}; + } + if ($errormessage eq '') { # Write configuration settings to file. &General::writehash("${General::swroot}/tor/settings", \%settings); -- 2.39.2