Bug#548417: debmirror: Transfer truncated

benedikt.wildenhain at hs-bochum.de benedikt.wildenhain at hs-bochum.de
Fri Sep 25 17:43:41 UTC 2015


Hello,

I can reproduce this problem in one of my networks. It occurs for some
files on security.debian.org. It can also be reproduced using curl (wget
works, as it automatically resumes the download):

The problem occurs both using a http proxy:
root at host:~# curl http://security.debian.org/debian-security/pool/updates/main/d/drupal7/drupal7_7.14.orig.tar.gz > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
 26 3055k   26  823k    0     0  1695k      0  0:00:01 --:--:--  0:00:01 1719k
curl: (18) transfer closed with 2284998 bytes remaining to read

And using a SOCKS proxy:
root at host:~# http_proxy= tsocks curl http://security.debian.org/debian-security/pool/updates/main/d/drupal7/drupal7_7.14.orig.tar.gz > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
 26 3055k   26  823k    0     0   504k      0  0:00:06  0:00:01  0:00:05 1389k
curl: (56) Recv failure: Connection reset by peer

I cannot access the Internet without a proxy from this network.

It worked over the HTTP-proxy after changing LWP::UserAgent:

$ diff /usr/share/perl5/LWP/UserAgent.pm /root/src/libwww-perl-6.13/debian/libwww-perl/usr/share/perl5/LWP/UserAgent.pm
898,904d897
< sub append_to_file
< {
<   my ($filename, $data) = @_;
<   open(FILE, ">>$filename");
<   print FILE $data;
<   close (FILE);
< }
935,956c928,929
<           if ($response->header('Accept-Ranges') eq 'bytes') {
<             warn "Transfer truncated: " . "only $file_length out of $content_length bytes received, retrying\n";
<
<             my $try = 0;
<             my $continue_at = $file_length + 1;
<
<             while ($try++ < 10 && $file_length < $content_length) {
<                my ($content_length) = $response->header('Content-length');
<                warn 'file_length:', $file_length, ' Ranges', "bytes=$continue_at-";
<
<                $request->header('Range' => "bytes=$file_length-");
<                $response = $self->request($request, sub { append_to_file($tmpfile, @_); }, 102400);
<
<                @stat        = stat("$tmpfile") or die "Could not stat tmpfile '$tmpfile': $!";
<                $file_length = $stat[7];
<                $continue_at = $file_length + 1;
<             }
<             }
<             else {
<               unlink($tmpfile);
<               die "Transfer truncated: " . "only $file_length out of $content_length bytes received\n"
<           }
---
>             unlink($tmpfile);
>             die "Transfer truncated: " . "only $file_length out of $content_length bytes received\n";



-- System Information:
Debian Release: 7.9
  APT prefers squeeze-lts
  APT policy: (500, 'squeeze-lts'), (500, 'oldoldstable-updates'), (500, 'oldoldstable'), (500, 'oldstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/1 CPU core)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libwww-perl depends on:
ii  ca-certificates             20130119+deb7u1
ii  libencode-locale-perl       1.03-1
ii  libfile-listing-perl        6.04-1
ii  libhtml-parser-perl         3.69-2
ii  libhtml-tagset-perl         3.20-2
ii  libhtml-tree-perl           5.02-1
ii  libhttp-cookies-perl        6.00-2
ii  libhttp-date-perl           6.02-1
ii  libhttp-message-perl        6.03-1
ii  libhttp-negotiate-perl      6.00-2
ii  liblwp-mediatypes-perl      6.02-1
ii  liblwp-protocol-https-perl  6.03-1
ii  libnet-http-perl            6.09-1
ii  liburi-perl                 1.60-1
ii  libwww-robotrules-perl      6.01-1
ii  netbase                     5.0
ii  perl                        5.14.2-21+deb7u2

Versions of packages libwww-perl recommends:
ii  libhtml-form-perl    6.03-1
ii  libhtml-format-perl  2.10-1
ii  libhttp-daemon-perl  6.01-1
ii  libmailtools-perl    2.09-1

Versions of packages libwww-perl suggests:
pn  libauthen-ntlm-perl  <none>

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20150925/46b6e864/attachment.sig>


More information about the pkg-perl-maintainers mailing list