Package: apt-cacher-ng
Version: 0.5.1-3
Severity: normal
Tags: upstream

I'm using apt-cacher-ng behind a corporate proxy. When I run apt-get update
on a client machine I get random errors like the following:

W: Failed to fetch 
http://apt-cacher-ng-host:3142/debian/dists/testing/main/binary-amd64/Packages.bz2
  Hash Sum mismatch
W: Failed to fetch 
http://apt-cacher-ng-host:3142/debian/dists/unstable/main/source/Sources.bz2  
Hash Sum mismatch
W: Failed to fetch 
http://apt-cacher-ng-host:3142/debian/dists/unstable/non-free/binary-amd64/Packages.bz2
  Hash Sum mismatch

This is because the apt-cacher-ng cache contains incoherent files. For example
a Release file of the day and a Release.gpg file of the day before. If I use
apt-get through my corporate proxy, without apt-cacher-ng everything is ok.

I compared apt-cacher-ng and direct apt-get HTTP traffic and found that 
apt-cacher-ng
miss a Cache-Control field in each HTTP headers.

I made the following changes in the source:

--- a/source/dljob.cc
+++ b/source/dljob.cc
@@ -125,7 +125,8 @@ bool tDlJob::AppendRequest(string sForThisHostOnly, tSS 
&head)

        head << (m_pStorage->m_bHeadOnly ? "HEAD " : "GET ")
                        << (m_parent->m_proxy ? RemoteUri() : RemotePath()) << 
" HTTP/1.1\r\n"
-       "Host: " << GetPeerName() << "\r\nConnection: keep-alive\r\n";
+       "Host: " << GetPeerName() << "\r\nConnection: keep-alive\r\n"
+       "Cache-Control: no-store,no-cache,max-age=0\r\n";

        if (m_parent->m_proxy) // also add authorization if there is any
        {

and now it works.

It would be nice to allow to configure the content of the Cache-Control 
field in the acng.conf file (apt.conf have it).

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (900, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/8 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages apt-cacher-ng depends on:
ii  adduser                 3.112+nmu2       add and remove users and groups
ii  debconf [debconf-2.0]   1.5.38           Debian configuration management sy
ii  libbz2-1.0              1.0.5-6          high-quality block-sorting file co
ii  libc6                   2.11.2-11        Embedded GNU C Library: Shared lib
ii  libfuse2                2.8.4-1.1        Filesystem in USErspace library
ii  libgcc1                 1:4.4.5-10       GCC support library
ii  libstdc++6              4.4.5-10         The GNU Standard C++ Library v3
ii  zlib1g                  1:1.2.3.4.dfsg-3 compression library - runtime

Versions of packages apt-cacher-ng recommends:
ii  ed                            1.4-3      The classic UNIX line editor
ii  perl                          5.10.1-17  Larry Wall's Practical Extraction

apt-cacher-ng suggests no packages.

-- Configuration Files:
/etc/apt-cacher-ng/security.conf [Errno 13] Permission denied: 
u'/etc/apt-cacher-ng/security.conf'

-- debconf information excluded



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

Reply via email to