cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: boundary condition for --continue-at - and --fail

From: David Byron <DByron_at_everdreamcorp.com>
Date: Fri, 27 Jun 2003 08:20:11 -0700

On Fri, 27 Jun 2003, Daniel Stenberg wrote:

> In other words, if we already have downloaded N bytes and we
> ask for a resumed transfer we ask the server to start sending
> byte N+1. The server does not have such a byte for the file,
> and returns 416 "Requested Range Not Satisfiable".
>
> I would argue that by using --fail, you should get this.

All of this makes sense to me. I probably just have to add some logic in my
code to not call curl if the file is already 100% there. Unfortunately, I
may not know if it's 100% there because I don't always know how big it's
supposed to be.

It seems like curl would know this somewhere along the way to returning an
error. I'm an http beginner but is this info in an http header somewhere?
Something like content-length? Maybe I need to send a separate message with
--head to get this.

I added --trace trace.out to my command line to see what I could find. This
is what I see in trace.out:

== Info: About to connect() to www.gnu.org:80
== Info: Connected to www.gnu.org (199.232.41.10) port 80
=> Send header, 245 bytes (0xf5)
0000: 47 45 54 20 2f 6d 61 6e 75 61 6c 2f 65 6d 61 63 GET /manual/emac
0010: 73 2f 70 73 2f 65 6d 61 63 73 2e 70 73 2e 67 7a s/ps/emacs.ps.gz
0020: 20 48 54 54 50 2f 31 2e 31 0d 0a 52 61 6e 67 65 HTTP/1.1..Range
0030: 3a 20 62 79 74 65 73 3d 31 30 32 39 36 36 30 2d : bytes=1029660-
0040: 0d 0a 55 73 65 72 2d 41 67 65 6e 74 3a 20 63 75 ..User-Agent: cu
0050: 72 6c 2f 37 2e 31 30 2e 35 20 28 77 69 6e 33 32 rl/7.10.5 (win32
0060: 29 20 6c 69 62 63 75 72 6c 2f 37 2e 31 30 2e 35 ) libcurl/7.10.5
0070: 20 4f 70 65 6e 53 53 4c 2f 30 2e 39 2e 37 61 20 OpenSSL/0.9.7a
0080: 7a 6c 69 62 2f 31 2e 31 2e 34 0d 0a 48 6f 73 74 zlib/1.1.4..Host
0090: 3a 20 77 77 77 2e 67 6e 75 2e 6f 72 67 0d 0a 50 : www.gnu.org..P
00a0: 72 61 67 6d 61 3a 20 6e 6f 2d 63 61 63 68 65 0d ragma: no-cache.
00b0: 0a 41 63 63 65 70 74 3a 20 69 6d 61 67 65 2f 67 .Accept: image/g
00c0: 69 66 2c 20 69 6d 61 67 65 2f 78 2d 78 62 69 74 if, image/x-xbit
00d0: 6d 61 70 2c 20 69 6d 61 67 65 2f 6a 70 65 67 2c map, image/jpeg,
00e0: 20 69 6d 61 67 65 2f 70 6a 70 65 67 2c 20 2a 2f image/pjpeg, */
00f0: 2a 0d 0a 0d 0a *....
== Info: The requested file was not found
== Info: Connection #0 left intact

Is there something else I can do to see the server's 416 response?

Thanks for your help.

-DB

--
David Byron                   dbyron_at_everdream.com
Everdream                     http://www.everdream.com
6591 Dumbarton Circle         voice:(510)818-5550
Fremont, CA  94555            fax:(510)818-5510
-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
Received on 2003-06-27