cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Stopping a "multi" transfer

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 10 Mar 2003 12:05:28 +0100 (CET)

On Sun, 9 Mar 2003, Martin C. Martin wrote:

> What's the right way to stop a multi transfer in mid-transfer? I'm writing
> a streaming audio client, and when the user wants to switch to a different
> source (or just stop), I need to stop the transfer.

Right, this is an area where I haven't been focusing much lately.

> curl_multi_cleanup says:
>
> * It does not free or
> * touch any individual easy handles in any way. We need to
> define
> * in what state those handles will be if this function is called
> * in the middle of a transfer.
>
> which doesn't give me a lot of hope. On the other hand, if I take my easy
> handle out of the multi, can I just call "curl_easy_cleanup()" on it?

That's the way I'd say is the prefered way.

> Does curl_easy_cleanup() know about the nefarious activities that the multi
> interface may have been up to?

No, but the general thought is that it shouldn't need to either. The
multi-related stuff should be removed when you do multi_remove_handle() and
then there should only be easy-related stuff left to take care of and that
should be made by easy_cleanup()...

Currently, I can only advice you to go with this approach and cross my
fingers it works fine. If you do experience any problems, please let us know
and don't hesitate to check out the sources and single-step your ways around
a little! ;-)

Oh, and feel free to suggest what updates to the docs we need to make this
more apparent there...

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-03-10