From 28c9dec6b4c7c96a8a6fe8cd6cb4ebc09c3d18d3 Mon Sep 17 00:00:00 2001 From: Maniacikarus Date: Sun, 7 Dec 2008 14:10:54 +0100 Subject: [PATCH] Proxy CGI new algo to calc redirectors added filedescriptor option --- html/cgi-bin/proxy.cgi | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/html/cgi-bin/proxy.cgi b/html/cgi-bin/proxy.cgi index d41d0af4f0..1a4453a777 100644 --- a/html/cgi-bin/proxy.cgi +++ b/html/cgi-bin/proxy.cgi @@ -272,7 +272,7 @@ $proxysettings{'IDENT_USER_ACL'} = 'positive'; $proxysettings{'ENABLE_FILTER'} = 'off'; $proxysettings{'ENABLE_UPDXLRATOR'} = 'off'; $proxysettings{'ENABLE_CLAMAV'} = 'off'; -$proxysettings{'CHILDREN'} = '5'; +$proxysettings{'CHILDREN'} = '10'; $ncsa_buttontext = $Lang::tr{'advproxy NCSA create user'}; @@ -332,14 +332,14 @@ if ($proxysettings{'ACTION'} eq $Lang::tr{'edit'}) } if (($proxysettings{'ACTION'} eq $Lang::tr{'save'}) || ($proxysettings{'ACTION'} eq $Lang::tr{'advproxy save and restart'})) -{ - if ($proxysettings{'ENABLE'} !~ /^(on|off)$/ || - $proxysettings{'TRANSPARENT'} !~ /^(on|off)$/ || - $proxysettings{'ENABLE_BLUE'} !~ /^(on|off)$/ || +{ + if ($proxysettings{'ENABLE'} !~ /^(on|off)$/ || + $proxysettings{'TRANSPARENT'} !~ /^(on|off)$/ || + $proxysettings{'ENABLE_BLUE'} !~ /^(on|off)$/ || $proxysettings{'TRANSPARENT_BLUE'} !~ /^(on|off)$/ ) { $errormessage = $Lang::tr{'invalid input'}; goto ERROR; - } + } if (!(&General::validport($proxysettings{'PROXY_PORT'}))) { $errormessage = $Lang::tr{'advproxy errmsg invalid proxy port'}; @@ -359,7 +359,7 @@ if (($proxysettings{'ACTION'} eq $Lang::tr{'save'}) || ($proxysettings{'ACTION'} { $errormessage = $Lang::tr{'advproxy errmsg mem cache size'}; goto ERROR; - } + } my @free = `/usr/bin/free`; $free[1] =~ m/(\d+)/; $cachemem = int $1 / 2048; @@ -434,8 +434,8 @@ if (($proxysettings{'ACTION'} eq $Lang::tr{'save'}) || ($proxysettings{'ACTION'} } } } - if ((!($proxysettings{'AUTH_MAX_USERIP'} eq '')) && - ((!($proxysettings{'AUTH_MAX_USERIP'} =~ /^\d+/)) || ($proxysettings{'AUTH_MAX_USERIP'} < 1) || ($proxysettings{'AUTH_MAX_USERIP'} > 255))) + if ((!($proxysettings{'AUTH_MAX_USERIP'} eq '')) && + ((!($proxysettings{'AUTH_MAX_USERIP'} =~ /^\d+/)) || ($proxysettings{'AUTH_MAX_USERIP'} < 1) || ($proxysettings{'AUTH_MAX_USERIP'} > 255))) { $errormessage = $Lang::tr{'advproxy errmsg max userip'}; goto ERROR; @@ -970,18 +970,18 @@ if ( $count < 1 ){$count = 1;} if ( -e "/usr/bin/squidclamav" ) { print "".$Lang::tr{'advproxy squidclamav'}."
"; print $Lang::tr{'advproxy enabled'}."
"; - print "+ ".int(sqrt($count) * 8); + print "+ ".int(( $count**(1/3)) * 8); print ""; } else { print ""; } print "".$Lang::tr{'advproxy url filter'}."
"; print $Lang::tr{'advproxy enabled'}."
"; -print "+ ".int(sqrt($count) * 6); +print "+ ".int(($count**(1/3)) * 6); print ""; print "".$Lang::tr{'advproxy update accelerator'}."
"; print $Lang::tr{'advproxy enabled'}."
"; -print "+ ".int(sqrt($count) * 6); +print "+ ".int(($count**(1/3)) * 5); print ""; print < @@ -1324,7 +1324,7 @@ END # ------------------------------------------------------------------- -print < @@ -1513,7 +1513,7 @@ print <     - +
@@ -2913,7 +2913,7 @@ END { @temp = split(/\//); if ( - ($temp[0] ne $netsettings{'GREEN_NETADDRESS'}) && ($temp[1] ne $netsettings{'GREEN_NETMASK'}) && + ($temp[0] ne $netsettings{'GREEN_NETADDRESS'}) && ($temp[1] ne $netsettings{'GREEN_NETMASK'}) && ($temp[0] ne $netsettings{'BLUE_NETADDRESS'}) && ($temp[1] ne $netsettings{'BLUE_NETMASK'}) ) { @@ -3031,6 +3031,7 @@ cache_effective_group squid umask 022 pid_filename /var/run/squid.pid +max_filedescriptors 4096 cache_mem $proxysettings{'CACHE_MEM'} MB END @@ -3184,7 +3185,7 @@ END print MSNTCONF "allowusers $ntlmdir/msntauth.allowusers\n"; } else { print MSNTCONF "denyusers $ntlmdir/msntauth.denyusers\n"; - } + } } close(MSNTCONF); } @@ -3268,7 +3269,7 @@ END if ($proxysettings{'ENABLE_BROWSER_CHECK'} eq 'on') { print FILE "acl with_allowed_useragents browser $browser_regexp\n\n"; } - print FILE "acl within_timeframe time "; + print FILE "acl within_timeframe time "; if ($proxysettings{'TIME_MON'} eq 'on') { print FILE "M"; } if ($proxysettings{'TIME_TUE'} eq 'on') { print FILE "T"; } if ($proxysettings{'TIME_WED'} eq 'on') { print FILE "W"; } @@ -3500,7 +3501,7 @@ if ($delaypools) { print FILE "delay_access 2 deny all\n"; } - print FILE "delay_initial_bucket_level 100\n"; + print FILE "delay_initial_bucket_level 100\n"; print FILE "\n"; } @@ -3606,7 +3607,7 @@ END if (($proxysettings{'AUTH_METHOD'} eq 'ntlm') && ($proxysettings{'NTLM_ENABLE_INT_AUTH'} eq 'on')) { if ($proxysettings{'NTLM_ENABLE_ACL'} eq 'on') - { + { if (($proxysettings{'NTLM_USER_ACL'} eq 'positive') && (!-z "$ntlmdir/msntauth.allowusers")) { print FILE " for_acl_users"; @@ -3651,7 +3652,7 @@ END if (($proxysettings{'AUTH_METHOD'} eq 'ntlm') && ($proxysettings{'NTLM_ENABLE_INT_AUTH'} eq 'on')) { if ($proxysettings{'NTLM_ENABLE_ACL'} eq 'on') - { + { if (($proxysettings{'NTLM_USER_ACL'} eq 'positive') && (!-z "$ntlmdir/msntauth.allowusers")) { print FILE " for_acl_users"; -- 2.39.2