From f8b2f07e52c6dc13b3bfdbad29b2f3a45f2cda6c Mon Sep 17 00:00:00 2001 From: Maarten Vanraes Date: Mon, 6 Jan 2020 08:54:50 +0100 Subject: handle 0 sized results when transferring --- urpmi-proxy.cgi | 4 ++-- 1 file 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'); } -- cgit v1.2.1