diff options
author | Maarten Vanraes <alien@mageia.org> | 2020-01-06 08:54:50 +0100 |
---|---|---|
committer | Maarten Vanraes <alien@mageia.org> | 2020-01-06 08:54:50 +0100 |
commit | f8b2f07e52c6dc13b3bfdbad29b2f3a45f2cda6c (patch) | |
tree | b4e83aadaca8d3e90d641d0867ad4c5c978d318f | |
parent | 6a4e1eca43b969db22ec8eb5d0f6aa012dec9198 (diff) | |
download | urpmi-proxy-f8b2f07e52c6dc13b3bfdbad29b2f3a45f2cda6c.tar urpmi-proxy-f8b2f07e52c6dc13b3bfdbad29b2f3a45f2cda6c.tar.gz urpmi-proxy-f8b2f07e52c6dc13b3bfdbad29b2f3a45f2cda6c.tar.bz2 urpmi-proxy-f8b2f07e52c6dc13b3bfdbad29b2f3a45f2cda6c.tar.xz urpmi-proxy-f8b2f07e52c6dc13b3bfdbad29b2f3a45f2cda6c.zip |
handle 0 sized results when transferring
-rwxr-xr-x | urpmi-proxy.cgi | 4 |
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'); } |