mirror of
https://github.com/webmin/webmin.git
synced 2025-07-25 15:09:18 +00:00
Support rock-format caches
This commit is contained in:
@ -39,7 +39,8 @@ if (!$in{'nouser'}) {
|
|||||||
# valid directives)
|
# valid directives)
|
||||||
my @cachestruct = &find_config("cache_dir", $conf, 2);
|
my @cachestruct = &find_config("cache_dir", $conf, 2);
|
||||||
if ($squid_version >= 2.3) {
|
if ($squid_version >= 2.3) {
|
||||||
@cachestruct = grep { $_->{'values'}->[1] =~ /^\// } @cachestruct;
|
@cachestruct = grep { $_->{'values'}->[1] =~ /^\// &&
|
||||||
|
-d $_->{'values'}->[1] } @cachestruct;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@cachestruct = grep { $_->{'values'}->[0] } @cachestruct;
|
@cachestruct = grep { $_->{'values'}->[0] } @cachestruct;
|
||||||
|
@ -528,7 +528,9 @@ my (@caches, $coss);
|
|||||||
my @cachestruct = &find_config("cache_dir", $conf);
|
my @cachestruct = &find_config("cache_dir", $conf);
|
||||||
my $disabled = 0;
|
my $disabled = 0;
|
||||||
if ($distoo && !@cachestruct) {
|
if ($distoo && !@cachestruct) {
|
||||||
|
# Check disabled cache directives, but exclude ones that don't exist
|
||||||
@cachestruct = &find_config("cache_dir", $conf, 1);
|
@cachestruct = &find_config("cache_dir", $conf, 1);
|
||||||
|
@cachestruct = grep { -e $_->{'values'}->[1] } @cachestruct;
|
||||||
$disabled = 1 if (@cachestruct);
|
$disabled = 1 if (@cachestruct);
|
||||||
}
|
}
|
||||||
if (@cachestruct) {
|
if (@cachestruct) {
|
||||||
@ -548,13 +550,13 @@ if (!@caches) {
|
|||||||
if ($coss) {
|
if ($coss) {
|
||||||
# Allow COSS files too
|
# Allow COSS files too
|
||||||
foreach my $c (@caches) {
|
foreach my $c (@caches) {
|
||||||
return 0 if (!-f $c && (!-d $c || !-d "$c/00"));
|
return 0 if (!-f $c && (!-d $c || (!-d "$c/00" && !-r "$c/rock")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# Check for dirs only
|
# Check for dirs only
|
||||||
foreach my $c (@caches) {
|
foreach my $c (@caches) {
|
||||||
return 0 if (!-d $c || !-d "$c/00");
|
return 0 if (!-d $c || (!-d "$c/00" && !-r "$c/rock"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
Reference in New Issue
Block a user