cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: patch - select.c / Curl_socket_check() interrupted

From: Maxime Larocque <maxmtl2002_at_yahoo.ca>
Date: Mon, 13 Aug 2012 17:23:14 -0400

Hi Daniel & the list,

Le 07/08/2012 17:29, Daniel Stenberg a écrit :
>
> Thanks a lot for the patch and your work on this, I finally got around
> to merge and push it!

Thank you!

>> - Curl_pp_multi_statemach(), in pingpong.c which returns
>> CURLE_OUT_OF_MEMORY. Curl_socket_check() should not fail anyways, and
>> I'm not sure which code should be returned...
>
> As 0 from Curl_socket_check() implies a timeout, isn't
> CURLE_OPERATION_TIMEDOUT the logical return code then?

When Curl_socket_check() returns 0 (ie timeout) or a positive value (ie
a socket event), Curl_pp_multi_statemach() handles it correctly. When -1
is returned by Curl_socket_check(), a CURLE_OUT_OF_MEMORY is returned to
the user.

Curl_socket_check() will only return -1 when there is a bug causing
select/poll to fail (which I got, the CURLE_OUT_OF_MEMORY led me to an
incorrect path), or if select/poll really returned ENOMEM.

So, in short, the code in Curl_pp_multi_statemach() is correct, and it
already has a failf() to report the select/poll error when in
development mode...

Regards,

Maxime

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-08-13