I am at a slight disadvantage here as I can't actually reproduce this
behaviour which makes debugging and testing difficult.

Could you try this patch instead and see if it is better?

Thanks for your help.

Mark


diff --git a/apt-cacher b/apt-cacher
index 48741b6..7c58fae 100755
--- a/apt-cacher2
+++ b/apt-cacher2
@@ -844,14 +844,19 @@ sub return_file {
                $headstring .= 'Connection: '.($concloseflag ? 'Close' : 
'Keep-Alive')."\r\n";
 
                # keep only parts interesting for apt
-               for(<$in>) {
-                   if(/^Last-Modified|Content|Accept|ETag|Age/) {
-                       $headstring.=$_;
-                       if(/^Content-Length:\ *(\d+)/) {
-                           $explen=$1;
+               if ($code==200) {
+                   for(<$in>) {
+                       if(/^Last-Modified|Content|Accept|ETag|Age/) {
+                           $headstring.=$_;
+                           if(/^Content-Length:\ *(\d+)/) {
+                               $explen=$1;
+                           }
                        }
                    }
                }
+               else {
+                   $headstring.='Content-Length: 0';
+               }
                close($in);
                &release_global_lock;
 
@@ -861,7 +866,7 @@ sub return_file {
                debug_message("Header sent: $headstring");
 
                # Stop after sending the header with errors
-               return if HTTP::Status::is_server_error($code);
+               return if HTTP::Status::is_error($code);
 
            }
            else {



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to