W3C home > Mailing lists > Public > www-lib@w3.org > January to March 2003

RE: HTFTP: Support for resuming downloads with "REST" [patch]

From: Tim Serong <tim.serong@conceiva.com>
Date: Tue, 18 Mar 2003 14:25:44 +1100
Message-ID: <8501919721C3DE4C81BCA22846B08721BC15@lazarus.conceiva.com>
To: "Sinha, Raj (Raj)" <rajsinha@avaya.com>
Cc: <www-lib@w3.org>

On Saturday, 15 March 2003 03:39, Sinha, Raj (Raj) wrote:
>
> I am sorry i did not catch the full discussion. But there
> is a discussion for our project to use libwww for downloading
> code into our embedded devices. 

I'm probably not the best one to ask, having only been working with
libwww for a couple of weeks.  The first thing that would scare me about
using libwww in an embedded device is memory footprint.  At a guess
(using my Windows box) the smallest I can easily make the libwww DLLs is
about 500 KB.  This is based on using wwwapp, wwwcache, wwwcore, wwwdir,
wwwdll, wwwfile, wwwhttp, wwwinit, wwwmime, wwwstream, wwwtrans and
wwwutils.

> Can you please provide me the best possible way to do this.
> What modules should i look into it. They want to usee http.
> can we take care of broken downloads and other such issues.

Try the Library Architecture and User's Guide at
http://www.w3.org/Library/User/
Also, take a look at chunk.c and LoadToFile.c in the Examples directory
for a starting point for downloading data given a URL.  Basically, you
do this:

- Initialize the library (HTProfile_newNoCacheClient)
- Set up a couple of callbacks and handlers 
- Create a new Request object (HTRequest_new)
- Start the request (HTLoadToFile or HTLoadToChunk)
- Go into an event loop
- Do something with the data when it has arrived.
- Clean up

Broken downloads can be handled by sending the request again, but give
it a range of bytes to download using HTRequest_addRange.  You should
probably check that the server supports "Accept-Ranges: bytes" before
doing this though.

Finally, if you haven't already done so, digging through the mailing
list archives can be quite illuminating.

Regards,

Tim Serong
-- 
tim.serong@conceiva.com
http://www.conceiva.com
Received on Monday, 17 March 2003 22:25:28 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:43 GMT