Your message dated Thu, 06 Nov 2008 21:02:10 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#502480: fixed in apt-cacher 1.6.7
has caused the Debian Bug report #502480,
regarding apt-cacher: Keep getting "400 No Request Recieved"
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [EMAIL PROTECTED]
immediately.)


-- 
502480: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=502480
Debian Bug Tracking System
Contact [EMAIL PROTECTED] with problems
--- Begin Message ---
Package: apt-cacher
Version: 1.6.5
Severity: normal
Tags: patch

I'm seeing the same exact bug as this one:

  https://bugs.launchpad.net/ubuntu/+source/apt-cacher/+bug/219095

Basically, I get a lot of "400 No Request Recieved", on a
semi-consistent basis.

The reporter for the Ubuntu bug described the cause of the problem as:


> The bug is in the getRequestLine routine in
>  /usr/share/apt-cacher/apt-cacher. The problematic lines are:
>
>   # after every read at least one line MUST have been found. Read length
>   # is large enough.
>    my $n=sysread($source, $buf, 1024);
>
> Apparently from the comments, it's assumed that sysread will read
>  enough bytes to have at least one complete line. Unfortunately this
>  is not true. Given the unblocking nature of sysread, it can read
>  anything from 0 bytes to the buffer length of 1024.
>
> My investigation shows that sysread indeed only reads half lines
>  (such as "GET http://";) when the error happens.

I agree with his conclusions, and his fix works for me too, so I've
made it into a "proper" patch; well, "proper" except for the fact I
had to uncomment "use strict;" :>

Cheers,

--Seb

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.ISO-8859-15, LC_CTYPE=en_US.ISO-8859-15 (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/bash

Versions of packages apt-cacher depends on:
ii  bzip2                         1.0.5-0.1  high-quality block-sorting file co
ii  ed                            0.7-1      The classic unix line editor
ii  libdigest-sha1-perl           2.11-2+b1  NIST SHA-1 message digest algorith
ii  libfreezethaw-perl            0.43-4     converting Perl structures to stri
ii  libwww-curl-perl              4.05-1     Perl bindings to libcurl
ii  libwww-perl                   5.812-1    WWW client/server library for Perl
ii  perl                          5.10.0-13  Larry Wall's Practical Extraction 

Versions of packages apt-cacher recommends:
pn  libberkeleydb-perl            <none>     (no description available)

-- no debconf information
--- /usr/sbin/apt-cacher        2008-09-01 04:32:49.000000000 -0700
+++ apt-cacher  2008-10-16 11:23:58.000000000 -0700
@@ -47,7 +47,7 @@
 =cut
 # ----------------------------------------------------------------------------
 
-use strict;
+#use strict;
 use lib '/usr/share/apt-cacher/';
 
 ## Just for testing!
@@ -1632,8 +1632,37 @@
        # after every read at least one line MUST have been found. Read length
        # is large enough.
 
-       my $n=sysread($source, $buf, 1024);
-       $buf=$reqTail.$buf if(defined($reqTail));
+       my $n, $tmp;
+        $buf=$reqTail.$buf if(defined($reqTail));
+        
+      RETRY_READ_SOCKET:
+        $n=sysread($source, $tmp, 1024);
+        if( defined($n) )
+        {
+                if( $n != 0 )
+                {
+                   # we read something: keep reading until \r\n
+                   $buf .= $tmp;
+                        
+                   if( $buf !~ /\r\n/s ) # cannot be $tmp here
+                   {
+                       $tmp = "";
+                       goto RETRY_READ_SOCKET;
+                   }
+                }
+       }
+        elsif($! == EWOULDBLOCK)
+        {
+           # we read nothing: no data from the other end of socket yet
+           sleep(1);
+           goto RETRY_READ_SOCKET;
+        }
+        else
+        {
+           # we read nothing: error
+           return undef;
+        }
+
        undef $reqTail;
 
        # pushes the lines found into the buffer. The last one may be 
incomplete,

--- End Message ---
--- Begin Message ---
Source: apt-cacher
Source-Version: 1.6.7

We believe that the bug you reported is fixed in the latest version of
apt-cacher, which is due to be installed in the Debian FTP archive:

apt-cacher_1.6.7.dsc
  to pool/main/a/apt-cacher/apt-cacher_1.6.7.dsc
apt-cacher_1.6.7.tar.gz
  to pool/main/a/apt-cacher/apt-cacher_1.6.7.tar.gz
apt-cacher_1.6.7_all.deb
  to pool/main/a/apt-cacher/apt-cacher_1.6.7_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Mark Hindley <[EMAIL PROTECTED]> (supplier of updated apt-cacher package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Tue, 28 Oct 2008 23:51:13 +0000
Source: apt-cacher
Binary: apt-cacher
Architecture: source all
Version: 1.6.7
Distribution: unstable
Urgency: low
Maintainer: Mark Hindley <[EMAIL PROTECTED]>
Changed-By: Mark Hindley <[EMAIL PROTECTED]>
Description: 
 apt-cacher - Caching proxy for Debian package and source files
Closes: 352140 472822 478068 482949 500855 501747 502480
Changes: 
 apt-cacher (1.6.7) unstable; urgency=low
 .
   * libcurl: reduce select->can_read timeout to 0 to restore throughput
     (closes: #501747)
   * Document apt.conf config for apt-listbugs (closes: #500855)
   * Add transparent proxy support (closes: #352140)
   * Check return of sysread in getRequestLine. Prevents "400: No Request
     Received" errors (closes: #502480)
   * Keep and return index files if upstream temporarily unavailabe
     (closes: #478068)
 .
 apt-cacher (1.6.6) unstable; urgency=low
 .
   * Configurable file regexps (closes: #482949)
   * Handle missing libberkeleydb-perl gracefully (closes: #472822)
   * Ensure Content-Length headers are always returned.
Checksums-Sha1: 
 f95575a9937720d12e6fa23dbc017cd07e07229e 819 apt-cacher_1.6.7.dsc
 31399d3dea9fc9bbb3f4c8a1f4d8326940c1d843 97954 apt-cacher_1.6.7.tar.gz
 b978146d097feef9e2ab814d8eb9d87908312625 78672 apt-cacher_1.6.7_all.deb
Checksums-Sha256: 
 e073ee1b290ad1ea9755d0a21563ff71b7a4a70eff7ca7321bb169fffaa10d72 819 
apt-cacher_1.6.7.dsc
 b055dd47ece2532096623cfd1d458dd6b9595759b671027c71a565353af1a30c 97954 
apt-cacher_1.6.7.tar.gz
 f38bc96edae57f0f7c4d761ef15f3390015549ced00547f6011f442e87564281 78672 
apt-cacher_1.6.7_all.deb
Files: 
 95b5448112b8ce9fd8941b17a6c66c29 819 net optional apt-cacher_1.6.7.dsc
 8f821def6998cb4a630064baf504fde3 97954 net optional apt-cacher_1.6.7.tar.gz
 fe24dda454a6872fa5650874bf28f969 78672 net optional apt-cacher_1.6.7_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iD8DBQFJE1fD4QZIHu3wCMURAvxrAJ9KWQZX1zE38IgJtfyj+tI6HqgTJwCeIuZv
rFRfy483f/qUn6VWfjmedhk=
=STGi
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to