cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: size trouble ?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 7 Aug 2007 12:19:52 +0200 (CEST)

On Tue, 7 Aug 2007, Sebastien WILLEMIJNS wrote:

> i do not know if SIZE command or size displayed in "RETR" server reply
> or twice is official (FTP) answer...

SIZE is an extension to the original FTP protocol, but that's the only
available way to reliably check for a file size. The size provided in the RETR
response is just sent embedded in a human readable string and extracting that
size is error-prone to say it gently.

> 0000: SIZE 100M
> <= Recv header, 24 bytes (0x18)
> 0000: 213 577749294136688640

So the server tells curl that the size of this file is 577749294136688640
bytes. I would call this a severly broken server (install/setup).

> 0000: RETR 100M
> <= Recv header, 69 bytes (0x45)
> 0000: 150 Opening BINARY mode data connection for 100M (104857600 byte
> 0040: s).

... but in the RETR response it claims 104857600 bytes. So the client diffs
you've seen simply is because difference clients have different hueristics on
how to get the size.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-08-07