On Fri, Aug 21, 2009 at 06:02:48PM -0400, Daniel Richard G. wrote:
> Package: apt-cacher
> Version: 1.6.8
> 
> This bug report is a spinoff of Bug#517761.

Could you try this patch

Mark

diff --cc apt-cacher
index 48741b6,48741b6..feee576
--- a/apt-cacher
+++ b/apt-cacher
@@@ -844,14 -844,14 +844,20 @@@ 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>) {
++                      chomp;
++                      if(/^Last-Modified|Content|Accept|ETag|Age/) {
++                          $headstring.=$_."\r\n";
++                          if(/^Content-Length:\ *(\d+)/) {
++                              $explen=$1;
++                          }
                        }
                    }
                }
++              else {
++                  $headstring.="Content-Length: 0\r\n";
++              }
                close($in);
                &release_global_lock;
  
@@@ -861,7 -861,7 +867,7 @@@
                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