Actually, I think I have seen the bug. Could you try the following patch
and see if it fixes it for you.

Thanks

Mark


commit 3e0e725027d5b54db2e8d66acaa97258714ccd6f
Author: Mark Hindley <[EMAIL PROTECTED]>
Date:   Sat Oct 18 23:27:13 2008 +0100

    Cleanup of getRequestLine

diff --git a/apt-cacher b/apt-cacher
index 6a4862a..c8d1811 100755
--- a/apt-cacher
+++ b/apt-cacher
@@ -1633,24 +1633,26 @@ sub getRequestLine {
          push(@reqLineBuf, "GET $cgi_path", '', undef); # undef stops operation
          undef $cgi_path; # don't re-add it
     }
-    if(! @reqLineBuf) {
-       my $buf='';
-
-       # 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));
-       undef $reqTail;
-
-       # pushes the lines found into the buffer. The last one may be 
incomplete,
-       # extra handling below
-       push(@reqLineBuf, split(/\r\n/, $buf, 1000) );
-
-       # buf did not end in a line terminator so the last line is an incomplete
-       # chunk. Does also work if \r and \n are separated
-       if(substr($buf, -2) ne "\r\n") {
-           $reqTail=pop(@reqLineBuf);
+    if([EMAIL PROTECTED]) {
+       # Fill buffer
+       if (my $ret=sysread($source, my $buf, 1024)) {
+
+           $buf=$reqTail.$buf if(defined($reqTail));
+           undef $reqTail;
+
+           # Split line and push into array.
+           # The last one may be incomplete,
+           # extra handling below
+           push(@reqLineBuf, split(/\r\n/, $buf, -1));
+
+           # $buf did not end in a line terminator so the last line is 
incomplete.
+           # Also works if \r and \n are separated
+           if(substr($buf, -2) ne "\r\n") {
+               $reqTail=pop(@reqLineBuf);
+           }
+       }
+       else {
+           info_message "Warning: Read failed: $!" if !defined $ret;
        }
     }
     return shift(@reqLineBuf);



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to