aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xurpmi-proxy.cgi4
1 files changed, 2 insertions, 2 deletions
diff --git a/urpmi-proxy.cgi b/urpmi-proxy.cgi
index e1fcf89..f7174d8 100755
--- a/urpmi-proxy.cgi
+++ b/urpmi-proxy.cgi
@@ -96,7 +96,7 @@ print STDERR "merge: $merge\n" if $debug;
# get datetime from local file if it exists
my @stat = lstat($cache_path . $file);
-if ($filename && scalar(@stat) > 0) {
+if ($filename && scalar(@stat) > 0 && $stat[7] > 0) {
print STDERR "timestamp: $stat[9]\n" if $debug;
# if the file needs no update checks, check in cache
return_file($cache_path, $file, $logfile, 'HIT_NO_CHECK', \@stat, $ip, $user_agent) if !$check_file;
@@ -397,7 +397,7 @@ else {
else {
$extra = 'AFTER_FAIL';
}
- return_file($cache_path, $file, $logfile, 'HIT' . $extra, \@stat, $ip, $user_agent) if $filename && scalar(@stat) > 0;
+ return_file($cache_path, $file, $logfile, 'HIT' . $extra, \@stat, $ip, $user_agent) if $filename && scalar(@stat) > 0 && $stat[7] > 0;
_log($logfile, $file, 404, 'MISS_FAIL', -1, $ip, $user_agent);
return_error(404, 'File not found');
}