cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: adding easy handles when using curl_multi_socket*

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 29 Apr 2008 22:19:36 +0200 (CEST)

On Tue, 29 Apr 2008, koettermarkus_at_gmx.de wrote:

> To conclude, there is a bug in the multi_socket api,
>
> curl_multi_socket_action can remove a socket from the hashlist and return
> CURLM_CALL_MULTI_PERFORM.

That libcurl function can and will deal with multiple connections so the
CURLM_CALL_MULTI_PERFORM may be due to things happening on other
connections/sockets! But yeah, it will of course lead to the function being
called on the same socket again and then you'll get a return code back since
that socket is then closed already! :-/

Is this situation easy for you to repeat? I'm not sure what the best fix for
this is: A) make that return code not happen when the specific socket passed
in has been removed or B) deal with the subsequent call on a deleted socket in
a better way or C) something else.

If it can be repeated, it could be used as a basis to try out a few
alternative fixes.

> The other thing about curl_multi_add_handle() registering the socket is
> resolved, the timeout_ms value was 0 ms, therefore there was no signal
> handler installed by the load.c code.

Do note that load.c is not an official example source code from us. The
official ones are in the docs/examples directory and we try to make those
accurate and functional. We can't take responsibility for other source codes
floating around.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2008-04-29