mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-26 02:42:58 +02:00
Increase performance of the squidclamav redirector.
To boost up the performance, now we trust the proxy cache. I add some changes to the proxy.cgi to configure the proxy and the squidclamav in the right way. I also add a hook that allows us to generate a new configuration if the cgi script will be launched from the shell. Fixes #10367.
This commit is contained in:
@@ -1008,4 +1008,27 @@ sub MakeUserAgent() {
|
||||
return $user_agent;
|
||||
}
|
||||
|
||||
# Function to read a file with UTF-8 charset.
|
||||
sub read_file_utf8 ($) {
|
||||
my ($file) = @_;
|
||||
|
||||
open my $in, '<:encoding(UTF-8)', $file or die "Could not open '$file' for reading $!";
|
||||
local $/ = undef;
|
||||
my $all = <$in>;
|
||||
close $in;
|
||||
|
||||
return $all;
|
||||
}
|
||||
|
||||
# Function to write a file with UTF-8 charset.
|
||||
sub write_file_utf8 ($) {
|
||||
my ($file, $content) = @_;
|
||||
|
||||
open my $out, '>:encoding(UTF-8)', $file or die "Could not open '$file' for writing $!";;
|
||||
print $out $content;
|
||||
close $out;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
Reference in New Issue
Block a user