📄 save_misc.cgi
字号:
#!/usr/local/bin/perl# save_misc.cgi# Save miscellaneous optionsrequire './squid-lib.pl';&ReadParse();$conf = &get_config();$whatfailed = "Failed to save options";&save_opt("dns_testnames", undef, $conf);&save_opt("logfile_rotate", \&check_rotate, $conf);&save_opt("append_domain", \&check_domain, $conf);if ($squid_version < 2) { &save_opt("ssl_proxy", \&check_proxy, $conf); &save_opt("passthrough_proxy", \&check_proxy, $conf); }&save_opt("err_html_text", undef, $conf);&save_choice("client_db", "on", $conf);&save_choice("forwarded_for", "on", $conf);&save_choice("log_icp_queries", "on", $conf);&save_opt("minimum_direct_hops", \&check_hops, $conf);if ($squid_version >= 2.2) { $m = $in{'anon_mode'}; if ($m == 0) { &save_directive($conf, "anonymize_headers", [ ]); } else { &save_directive($conf, "anonymize_headers", [ { 'name' => 'anonymize_headers', 'values' => [ $m==1 ? "allow" : "deny", $m==1 ? $in{'anon_allow'} : $in{'anon_deny'} ] } ]); } }else { &save_choice("http_anonymizer", "off", $conf); }&save_opt("fake_user_agent", undef, $conf);&save_choice("memory_pools", "on", $conf);if ($squid_version >= 2) { &save_opt_bytes("memory_pools_limit", $conf); }&flush_file_lines();&redirect("");sub check_rotate{return $_[0] =~ /^\d+$/ ? undef : "'$_[0]' is not a valid number of rotations";}sub check_domain{return $_[0] =~ /^[A-z0-9\.\-]+$/ ? undef : "'$_[0]' is not a valid domain";}sub check_proxy{return $_[0] =~ /^\S+$/ ? undef : "'$_[0]' is not a valid proxy";}sub check_hops{return $_[0] =~ /^\d+$/ ? undef : "'$_[0]' is not a valid number of hops";}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -