cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [Patch] curl_multi_fdset manpage tweak

From: Julien Chaffraix <julien.chaffraix_at_gmail.com>
Date: Mon, 21 Dec 2009 14:14:49 +0100

Hi,

On Sun, Dec 20, 2009 at 12:40 AM, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Fri, 18 Dec 2009, Julien Chaffraix wrote:
>
>> attached is a modification of the curl_multi_fdset manpage to make it
>> clear that newly created easy handles added to their multi handle needs to
>> call curl_multi_perform prior to calling curl_multi_fdset if they want to
>> get an up-to-date result. Comments on this change are more than welcome.
>
> The suggested wording shouldn't be a "warning" in my view. But yes, not a
> lot is done to a handle when you've just added it so chances are very slim
> that curl_multi_fdset() would return any socket info for that handle, as the
> *perform() (or related functions) is the one that actually performs anything
> (hence the name) of importance and performing network and protocol related
> stuff is what makes the socket get used and move over various states etc.

Indeed! My naive thought was that calling curl_multi_fdset() at
anytime would give me an up-to-date answer - which means updating the
handles as needed. I had to investigate to understand why it was not
the case and whether it was a bug.
I thought it was a pretty important "warning" to call *perform before
curl_multi_fdset as you can get obsolete results which could be
misleading. I am fairly open on the wording so if you prefer to drop
the "warning", I am ok with that.
My previous change is also quite limited to my testing and may be
broader (if a handle has finished, it could be in the fdset when we do
not expect it to be ..). What is the position of more knowledgeable
people about libcURL: does it sound sane to advice that
curl_multi_perform should be called to be sure that the
curl_multi_fdset() results are up-to-date?

> But you _can_ still call curl_multi_fdset() before the perform() call, it
> will still return the truth!

Agreed!

Regards,
Julien
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-12-21