Mark Hindley a écrit :
> Can you try this one instead. It addresses the only problem  can see
> with the logs.
> 
> 
> diff --git a/apt-cacher b/apt-cacher
> index 48741b6..feee576 100755
> --- a/apt-cacher2
> +++ b/apt-cacher2
> @@ -844,14 +844,20 @@ sub return_file {
>               $headstring .= 'Connection: '.($concloseflag ? 'Close' : 
> 'Keep-Alive')."\r\n";
>  
>               # keep only parts interesting for apt
> -             for(<$in>) {
> -                 if(/^Last-Modified|Content|Accept|ETag|Age/) {
> -                     $headstring.=$_;
> -                     if(/^Content-Length:\ *(\d+)/) {
> -                         $explen=$1;
> +             if ($code==200) {
> +                 for(<$in>) {
> +                     chomp;
> +                     if(/^Last-Modified|Content|Accept|ETag|Age/) {
> +                         $headstring.=$_."\r\n";
> +                         if(/^Content-Length:\ *(\d+)/) {
> +                             $explen=$1;
> +                         }
>                       }
>                   }
>               }
> +             else {
> +                 $headstring.="Content-Length: 0\r\n";
> +             }
>               close($in);
>               &release_global_lock;
>  
> @@ -861,7 +867,7 @@ sub return_file {
>               debug_message("Header sent: $headstring");
>  
>               # Stop after sending the header with errors
> -             return if HTTP::Status::is_server_error($code);
> +             return if HTTP::Status::is_error($code);
>  
>           }
>           else {
> 

I'm sorry, it still doesn't do the job. apt-updating on the apt-cacher
server gives me an error :

r...@ataz [517] ~$ aptitude -v update && aptitude -syv dist-upgrade
Ign file: binary/ Release.gpg
Ign file: binary/ Translation-fr
Ign file: binary/ Release
Ign file: binary/ Packages
Prendre : 1 http://localhost testing/updates Release.gpg [197B]
Ign http://localhost testing/updates/main Translation-fr
Err http://localhost testing/updates/contrib Translation-fr
  Erreur de lecture du serveur - read (104 Connexion ré-initialisée par
le correspondant)
Ign http://localhost testing/updates/non-free Translation-fr
Prendre : 2 http://localhost testing Release.gpg [197B]
Prendre : 3 http://localhost testing/main Translation-fr [646kB]
Ign http://localhost testing/non-free Translation-fr
Ign http://localhost testing/contrib Translation-fr
Prendre : 4 http://localhost testing-proposed-updates Release.gpg [197B]
Ign http://localhost testing-proposed-updates/main Translation-fr
Ign http://localhost testing-proposed-updates/non-free Translation-fr
Ign http://localhost testing-proposed-updates/contrib Translation-fr
Prendre : 5 http://localhost testing/updates Release [37,7kB]
Prendre : 6 http://localhost testing Release [78,3kB]
Prendre : 7 http://localhost testing-proposed-updates Release [54,5kB]
Ign http://localhost testing/updates/main Packages/DiffIndex
Ign http://localhost testing/updates/contrib Packages/DiffIndex
Ign http://localhost testing/updates/non-free Packages/DiffIndex
Ign http://localhost testing/updates/main Sources/DiffIndex
Ign http://localhost testing/updates/contrib Sources/DiffIndex
Ign http://localhost testing/updates/non-free Sources/DiffIndex
Prendre : 8 http://localhost testing/main Packages/DiffIndex [2038B]
Prendre : 9 http://localhost testing/non-free Packages/DiffIndex [2023B]
Atteint http://localhost testing/contrib Packages/DiffIndex
Prendre : 10 http://localhost testing/main Sources/DiffIndex [2038B]
Prendre : 11 http://localhost testing/non-free Sources/DiffIndex [2023B]
Atteint http://localhost testing/contrib Sources/DiffIndex
Atteint http://localhost testing-proposed-updates/main Packages/DiffIndex
Ign http://localhost testing-proposed-updates/non-free Packages/DiffIndex
Ign http://localhost testing-proposed-updates/contrib Packages/DiffIndex
Atteint http://localhost testing/updates/main Packages
Atteint http://localhost testing/updates/contrib Packages
Atteint http://localhost testing/updates/non-free Packages
Atteint http://localhost testing/updates/main Sources
Atteint http://localhost testing/updates/contrib Sources
Atteint http://localhost testing/updates/non-free Sources
Prendre : 12 http://localhost testing/main 2009-04-05-0239.52.pdiff [12,3kB]
Prendre : 13 http://localhost testing/main 2009-04-05-0239.52.pdiff [12,3kB]
Prendre : 14 http://localhost testing/main 2009-04-05-0239.52.pdiff [12,3kB]
Prendre : 15 http://localhost testing/non-free 2009-04-05-0239.52.pdiff
[625B]
Prendre : 16 http://localhost testing/non-free 2009-04-05-0239.52.pdiff
[625B]
Prendre : 17 http://localhost testing/non-free 2009-04-05-0239.52.pdiff
[625B]
Prendre : 18 http://localhost testing/main 2009-04-05-0239.52.pdiff [9758B]
Prendre : 19 http://localhost testing/main 2009-04-05-0239.52.pdiff [9758B]
Prendre : 20 http://localhost testing/main 2009-04-05-0239.52.pdiff [9758B]
Prendre : 21 http://localhost testing/non-free 2009-04-05-0239.52.pdiff
[644B]
Prendre : 22 http://localhost testing/non-free 2009-04-05-0239.52.pdiff
[644B]
Prendre : 23 http://localhost testing/non-free 2009-04-05-0239.52.pdiff
[644B]
Atteint http://localhost testing-proposed-updates/main Packages
Atteint http://localhost testing-proposed-updates/non-free Packages
Atteint http://localhost testing-proposed-updates/contrib Packages
Prendre : 24 http://localhost testing/main 2009-04-05-1557.49.pdiff [1085B]
Prendre : 25 http://localhost testing/main 2009-04-05-1557.49.pdiff [1085B]
Prendre : 26 http://localhost testing/main 2009-04-05-1557.49.pdiff [1085B]
Prendre : 27 http://localhost testing/main 2009-04-05-1557.49.pdiff [793B]
Prendre : 28 http://localhost testing/main 2009-04-05-1557.49.pdiff [793B]
Prendre : 29 http://localhost testing/main 2009-04-05-1557.49.pdiff [793B]
 851ko téléchargés en 41s (20,7ko/s)
Lecture des listes de paquets... Fait

État actuel : 0 paquet cassé [+0], 7 mises à jour restantes [+7], 22884
nouveaux paquets [+4].

I got the same error message on the same file from a client machine on
my home network.

Note that if I use the non-patched file I got the same error on the same
file sporadically. It looks like sometimes the server got overloaded,
sort of, probably depending on current and untrackable activity.

I'm sorry that I cannot help you more but I don't know how apt tools
work and my perl is sooooo basic.

pp



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