cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl question, Range support for http

From: Goswin von Brederlow <brederlo_at_informatik.uni-tuebingen.de>
Date: Fri, 26 Nov 2004 13:19:18 +0100

"Guillaume Arluison" <ga_at_lacde.net> writes:

>> > 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

Which sends one header, waits for the round robin, read all the
data, send second header, wait for the round robin, read, send, wait,
read, send, wait, read.

Notice all that waiting? If I have to do 10000+ requests all that
waiting accumulates to a severe performance penalty.

> 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.

Nope, I knew I could do that already.

MfG
        Goswin
Received on 2004-11-26