cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl question, Range support for http

From: Guillaume Arluison <ga_at_lacde.net>
Date: Fri, 26 Nov 2004 10:37:01 -0000

> > 1. Any support for Range in libcurl I didn't see?
> >
> > I saw that you can add custom headers but would libcurl handle the
server
> > responces right?
>
> It depends on what you think is "right". It will pass the response-body to
> you unaltered.
In fact with "more details" it's the server that will handle your request
differently with a Range present and should send to curl only the bits you
wanted (only if 1.1 actually), curl doesnt see and doesnt care the
difference : it's raw data for him anyway. So you ll have the wanted 100Kb
of your mp3 instead of having 3 Mb in return, it's up to you what you do
with them. :)

> > 3. Can I queue up a multitude of requests onto one easy_handler and then
> > perform them all?
>
> Nope.
To be even more precise to this and the other mail from Dan, what you ask is
exactly what an easy_handler can do for you it's just that YOU have to
manage the loop of elements to download instead of having it "inside curl".
Actually it is much more efficient this way :)
Which means depending on your binding :
for url in urls
do
curlObj->set(url)
curlObj->perform()
do whatever you want with the data retrieved
done

And curl is clever enough to reuse the same connection in the curlObj so if
your server doesnt close it (or any rare pb on the network) you ll be stick
to only one server with no dns/conenction delays for the other transfers.

Hope this helps.
____________________
<Gu>[W]ill[i]a<u>m<e>
http://www.lacde.net
----- Original Message -----
From: "Daniel Stenberg" <daniel-curl_at_haxx.se>
To: "libcurl development" <curl-library_at_cool.haxx.se>
Sent: Friday, November 26, 2004 9:04 AM
Subject: Re: libcurl question, Range support for http

> On Fri, 26 Nov 2004, Goswin von Brederlow wrote:
>
> > 1. Any support for Range in libcurl I didn't see?
> >
> > I saw that you can add custom headers but would libcurl handle the
server
> > responces right?
>
> It depends on what you think is "right". It will pass the response-body to
> you unaltered.
>
> > 2. How would libcurl pass back the data with Range: a-b,c-d,e-f
statement?
>
> Exactly the same way the server provides it. You need to deal with the
> boundaries and different parts etc.
>
> > 3. Can I queue up a multitude of requests onto one easy_handler and then
> > perform them all?
>
> Nope.
>
> --
> Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
> Dedicated custom curl help for hire: http://haxx.se/curl.html
>

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.789 / Virus Database: 534 - Release Date: 09/11/2004
Received on 2004-11-26