cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: multi_socket hanging when adding handles

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 2 May 2007 13:52:35 +0200 (CEST)

On Wed, 2 May 2007, Michael Wallner wrote:

>> I'll just need to clean it up and will commit soon to let you have
>> a go at it and make sure it runs fine for you as well.
>
> Oh great, thanks Daniel! That will save another few --surely odd-- hours of
> my life!

Please try the attached patch. The problem is as you guessed before, than
while calling only curl_multi_socket() on sockets that have action, only those
sockets and those that have a time-out triggered will be dealt with and when
you add a new socket it never got a chance to get socket "action" and it got
no time-out to expire either.

This makes sure there's a time-out expired immediately after
curl_multi_add_handle() and for each time curl_multi_socket/perform() return
CURLM_CALL_MULTI_PERFORM.

Anyway, with this applied your test snippet seems to run fine on my test box.
I'd be happy to get a confirmation from you before I commit.

--
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html

Received on 2007-05-02