curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Asynchronous ordered sends

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 24 Mar 2017 09:18:03 +0100 (CET)

On Thu, 23 Mar 2017, Richard Gray wrote:

> Is it safe to add a new easy handle to a multi handle in a read or write
> callback or would some other technique have to be used? Connection re-use
> could complicate things...

I would advice against calling any libcurl functions from within callbacks
unless they're specifically documented to support that. (I have a TODO item
somewhere to make sure we fail function calls done from within callbacks
unless we specifically support it. One of these days I'll get to that! =) )

You could just set a variable somewhere and in the general event loop check if
that variable changed since last time and then add the next handle. Or just
have a byte counter and see if X bytes from transfer 1 has been received, add
transfer 2 etc. But as Ray points out, starting later doesn't mean that it'll
finish later.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2017-03-24