On Wed, Mar 25, 2009 at 12:13:26AM +0100, Thomas Hahn wrote:
> On Sun, Mar 22, 2009 at 10:06:34AM +0000, Mark Hindley wrote:
> > On Wed, Mar 18, 2009 at 12:45:42AM +0100, Thomas Hahn wrote:
> >  
> > > with
> > > LANG=C apt-get update
> > > 
> > > the update runs without problems.
> > > Why am I the only one having this problem?
> > 
> > I don't know. I can't reproduce it so it is hard to get a handle on.
> > 
> > Can you run apt-get update with -o Debug::Acquire::http=true and let's
> > try to see what is the difference between the requests sent with the
> > different LANG settings.
> > 
> > Mark
> 
> Here we go. Attached you will find apt-get-update.debug.txt.gz 
> with LANG=en_US.ISO-8859-15 and apt-get-update.debug.LANGisC.txt.gz
> for LANG=C

Thanks.

I could see 2 problems, although I am not sure they are what is causing
what you see. I still can't reproduce the behaviour which make this
difficult to debug

Could you try this patch which fixes the header line terminations and
Content-Length for error pages. 

Thanks for you help and patience

Mark


diff --git a/apt-cacher b/apt-cacher
index 48741b6..feee576 100755
--- a/apt-cacher
+++ b/apt-cacher
@@ -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 +867,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