X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Ftor.cgi;h=0c5477fd60fa7040046b6d0e19df20627ecf37fd;hp=6b4d9cc1b25b370905d5331f30c231dc70acd7c2;hb=3308f8d09f5518c5f4654f5fe4b35d62eeee6642;hpb=13b5ce6e4068de1719ba69b67ea5b96291b7fe71 diff --git a/html/cgi-bin/tor.cgi b/html/cgi-bin/tor.cgi index 6b4d9cc1b..0c5477fd6 100644 --- a/html/cgi-bin/tor.cgi +++ b/html/cgi-bin/tor.cgi @@ -51,8 +51,7 @@ my @bandwidth_limits = ( 1024, # 1M 512, 256, - 128, - 64 + 160 ); my @accounting_periods = ('daily', 'weekly', 'monthly'); @@ -88,9 +87,6 @@ my $warnmessage = ''; &Header::showhttpheaders(); -# Load settings from file. -&General::readhash("${General::swroot}/tor/settings", \%settings); - # Get GUI values. &Header::getcgihash(\%settings); @@ -120,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); @@ -132,6 +136,9 @@ if ($settings{'ACTION'} eq $Lang::tr{'save'}) { $settings{'ACTION'} = ''; } +# Load settings from file. +&General::readhash("${General::swroot}/tor/settings", \%settings); + &showMainBox(); # Close Tor control connection. @@ -171,21 +178,19 @@ sub showMainBox() {
+ |