cURL / Mailing Lists / curl-library / Single Mail

curl-library

Réf. : Re: Pausing downloads with multi interface

From: Philippe HAMEAU <philippe.hameau_at_sagem.com>
Date: Tue, 20 Mar 2007 17:47:04 +0100

Hi.

Instead of pausing/resuming, can we imagine capping the upload/download
rate dynamically ? Of course, setting it to 0 would pause the transfer.

Thanks.

Phil

On Mon, 19 Mar 2007, Andrew Penner wrote:

> I have a nice app running with the multi interface that handles
asynchronous
> downloads. The problem is that I cannot guarantee that my data sink will
be
> able accommodate writing at the rate that write callbacks occur. To get
> around this, I implemented simple curl_multi_pause_handle and
> curl_multi_resume_handle to allow the data sink to have some control
over
> what's going on with the transfer.

Sounds like a great addition that fits perfectly with what I've been
wanting
to see for a long time. Does the pause affect both upload and download
simultaneously, or can you set either one independently?

> All I did was add a 'pause' flag to the SessionState structure. The
> curl_multi_perform and curl_multi_fdset functions simply ignore an easy
> handle if its pause flag is set. This actually seems to work after some
> simple tests.

... then I guess you pause both directions at once... While more
complicated
to add, I think it would make sense to be able to pause either direction
as I
can imagine use-cases where you want to upload and download but you only
have
a "flow control" need for one of the directions.

> I am not familiar with the internals of libcurl so I am asking for help
in
> identifying any flaws with this approach or steps that I may have
omitted.
> (Do I need to reset and timeouts, etc?)

Please post your current work as a diff -u patch as then we can test it in
our
ends and easier provide accurate comments on the approach and code.

> BTW, libcurl is a pleasure to deal with. Keep up the excellent work.

Thanks!

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
" Ce courriel et les documents qui y sont attaches peuvent contenir des informations confidentielles. Si vous n'etes  pas le destinataire escompte, merci d'en informer l'expediteur immediatement et de detruire ce courriel  ainsi que tous les documents attaches de votre systeme informatique. Toute divulgation, distribution ou copie du present courriel et des documents attaches sans autorisation prealable de son emetteur est interdite." 
" This e-mail and any attached documents may contain confidential or proprietary information. If you are not the intended recipient, please advise the sender immediately and delete this e-mail and all attached documents from your computer system. Any unauthorised disclosure, distribution or copying hereof is prohibited."
Received on 2007-03-20