On Mon, Jul 23, 2012 at 02:05:09AM +0800, Michael wrote:
> Package: apt-cacher
> Version: 1.7.4
> Severity: normal
> 
> Hi,
> 
> I -think- I've found a chunk-related bug. The initial symptom is a
> slow-running (due to waiting for server-end timeouts) apt-get update,
> accompanied by a BADSIG error from gpg.

Yes, chunked transfer is broken.

Does the following patch help?

Mark


commit 665dbe247863d635de4469af48f501ac53444cd8
Author: Mark Hindley <m...@hindley.org.uk>
Date:   Mon Jul 23 01:47:57 2012 +0100

    Don't allow Transfer-Encoding: chunked to leak through to clients.

diff --git a/apt-cacher b/apt-cacher
index 2d4309f..f719ec9 100755
--- a/apt-cacher
+++ b/apt-cacher
@@ -1629,9 +1629,16 @@ sub libcurl {
                        $cfg->{debug} && debug_message('libcurl reading of 
headers complete: ' . $response->code);
                        chomp_message($response);
                        if ($curl_request->method eq 'GET' && 
$response->is_success) {
+                           # Handle Chunked
+                           if ($response->header('Transfer-Encoding') && lc 
$response->header('Transfer-Encoding') eq 'chunked') {
+                               debug_message('Handle Transfer-Encoding: 
chunked');
+                               $response->remove_header('Content-Length');
+                               $response->remove_header('Transfer-Encoding');
+                           }
                            # Check space
                            my $statfs;
                            if (defined($statfs = df($cfg->{'cache_dir'}, 1)) &&
+                               $response->header('Content-Length') &&
                                $response->header('Content-Length') >=  
$statfs->{bavail} ||
                                $cfg->{_disk_usage_limit} && $statfs->{used} + 
$response->header >= $cfg->{_disk_usage_limit}) {
                                info_message('ALARM: Insuffient space for 
Content-Length: '.


-- 
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