Package: apt-cacher-ng
Version: 0.2.2-2
Severity: normal
Tags: patch

When apt-cacher-ng is used behind nginx (0.6.32) apt-get gets stuck on update.

After some investigation I discover that stuck happens when acng returns
answer without body (e.g. error 404) in "Connection: close" mode.
Neither acng nor nginx close this connection and stuck is happened.

I do not know acng or nginx should be blamed for that,
but I found acng is easier to fix.

-- System Information:
Debian Release: 5.0.1
  APT prefers stable
  APT policy: (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.29.1-avi (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to ru_RU.UTF-8)
Shell: /bin/sh linked to /bin/bash
commit 63bb20719770e8509a03eb3fd908d5c98f595083
Author: Alexander Inyukhin <shur...@sectorb.msk.ru>
Date:   Tue Apr 21 04:16:30 2009 +0400

    Close connections

diff --git a/source/job.cc b/source/job.cc
index 5646cf2..78a3a79 100644
--- a/source/job.cc
+++ b/source/job.cc
@@ -689,7 +689,7 @@ eJobResult job::SendData(int confd)
                                
 
                                case(STATE_ALLDONE):
-                                       return R_DONE;
+                                       return m_bCloseCon ? R_DISCON : R_DONE;
                                
                                case(STATE_NOWAYOUT):
                                default:

Reply via email to