cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: running_handles and the multi API

From: Robert Iakobashvili <coroberti_at_gmail.com>
Date: Mon, 1 Feb 2010 18:47:59 +0200

On Mon, Feb 1, 2010 at 2:48 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Mon, 1 Feb 2010, Robert Iakobashvili wrote:
>
> The downside of this fix, is that the counter we return in
>>> 'running_handles' in several of our public functions then gets a slightly
>>> new and possibly confusing behavior during times:
>>>
>>
>> curl-loader is using this number of "running handles" as the very
>> particular indication to continue processing, as in line 116:
>> http://curl-loader.svn.sourceforge.net/viewvc/curl-loader/trunk/curl-loader/loader_hyper.c?revision=566&view=markup
>>
>
> That should still work if I read things correctly. The returned counter
> will still be actual "alive" handles that need care. The difference is just
> for some cases the counter will never be incremented even though you add a
> handle, as that handle fails so fast it never gets to bump the value and
> thus it won't be decreased either.
>
> Or how do you see my suggestion would alter the behavior of your code?
>
>

I think you are right.

>
> Sometimes failure to connect a socket is a rather transient event e.g. due
>> to some pick load at server with a listen queue being full, or some
>> temporary network issue, thus at a next cycle such socket may be
>> successfully connected.
>>
>
> Yes a failed connect could work at next attempt, but libcurl itself doesn't
> do the retry. It simply properly informs that the connect failed and the
> application can then easily just re-add the handle again to get the
> connection retried.
>
>

So you are saying, the not-connected sockets were never included in the
count before.
Okay.

I would to test the patch in curl-loader. Is it passing the curl tests?

> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

-- 
Truly,
Robert Iakobashvili, Ph.D.
......................................................................
www.ghotit.com
Assistive technology that understands you
......................................................................

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-02-01