cURL / Mailing Lists / curl-users / Single Mail

curl-users

A complex case in which using file resume option will failed.

From: Hongyi Zhao <hongyi.zhao_at_gmail.com>
Date: Mon, 6 Apr 2015 10:00:37 +0800

Hi all,

I do some testings resume test by using the following method:

1- Downloading the following file with curl:

curl -O http://ftp.cn.debian.org/debian/dists/Debian7.8/main/binary-all/
Packages.bz2

2- Split the file into little files with the file size equaling to
128K as follows:

split -b 128K Packages.bz2

And at this point, I obtained the following 20 files:

werner_at_debian:~/http_resume_test$ ls x*
xaa xac xae xag xai xak xam xao xaq xas
xab xad xaf xah xaj xal xan xap xar xat

Then I delete the some files, say, xab and xae, from the above little
files, and then use the cat tool to regenerate the Packages.bz2 by only
using the remaining little files:

werner_at_debian:~/http_resume_test$ for i in `ls x*`; do cat $i >>
Packages.bz2; done

3- Then, I re-run curl with the following command to test the resume
option of curl by using the above re-generated Packages.bz2 file:

werner@debian:~/http_resume_test$ curl -C - -O http://ftp.cn.debian.org/
debian/dists/Debian7.8/main/binary-all/Packages.bz2
** Resuming transfer from byte position 1966080
  % Total % Received % Xferd Average Speed Time Time Time
Current
                                 Dload Upload Total Spent Left
Speed
  0 0 0 0 0 0 0 0 --:--:-- --:--:--
--:--:-- 0

4- Finally, I found that the result file is different from the original
one directly downloaded from that site (*):

werner_at_debian:~/http_resume_test$ diff Packages.bz2 ~/Packages.bz2
Binary files Packages.bz2 and /home/werner/Packages.bz2 differ
werner_at_debian:~/http_resume_test$

* Note 1: In the above command, the ~/Packages.bz2 is the original
Packages.bz2 file directly obtained from http://ftp.cn.debian.org/debian/
dists/Debian7.8/main/binary-all/Packages.bz2.

* Note 2: The url used for this test support the HTTP/1.1 range
operation, and the file can be resumed in a seperate abrupted opration
and then by using the `-C -' option.

Any hints?

Regards

-- 
Hongyi Zhao <hongyi.zhao_at_gmail.com>
Xinjiang Technical Institute of Physics and Chemistry
Chinese Academy of Sciences
GnuPG DSA: 0xD108493

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-04-06