On Mon, 1 Feb 2010, Ragnar Lonn wrote:
I think I understand, and without being very knowledgeable about all the
details my gut reaction is that method A sounds like a solution that is a
lot more solid.
Your comment that "even you have used that change in handle counter..." is
not a very good argument in favor of method B, and you even say so
implicitly when you also state that "the only good way to find the end of an
individual transfer is calling curl_multi_info_read()"
The running_handles counter is simple to use, yes, but relying on it to tell
you state changes does seem like over-using the feature. And don't get me
wrong, I'm the laziest programmer alive and I'm pretty sure my code will
always look worse than yours. Give me an API that allows me to make
shortcuts and I will! That's why I think it's a bad idea to allow even the
possibility. If running_handles is not a good way to detect state changes,
and maybe even not 100% accurate at telling the current state of things,
then I would degrade it to an "informational" feature without guarantees,
and document it as such. If the official stance (and the docs) say that this
feature should not be used for anything serious, then even I would probably
avoid that kind of behaviour.
Thanks a lot for your feedback.
Yes, I'm quite sure my alternative (A) is the only sane way forward and I plan
to get that committed soon.
I'll also revisit the documentation for the 'running_handles' to make sure we
document that properly and that we push for using curl_multi_info_read() to
accurately find completed transfers - successful or failed.
I will probably not work on an optimized curl_multi_info_read() myself until
after 7.20.0 and I would very much welcome help with that part. I think some
of you guys using an insane amount of easy handles in a single multi handle
can benefit with measureable amount from it. Right now, each call to
curl_multi_info_read() scans over ALL connected easy handles to see if there's
a message to return.
It should instead feature a simple list with easy handles.
--
/ daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html