curl-library
Re: Multi cURL connect bug
Date: Mon, 8 Jul 2013 12:41:35 -0400
On Mon, Jul 8, 2013 at 2:44 AM, Yehezkel Horowitz
<horowity_at_checkpoint.com> wrote:
>
> > The goal of this email was to know if there's a way to distinguish these 2 cases, so a.php can make the appropriate decision.
>
> Are you looking for something like curl_multi_info_read ?
>
> You can combine it with curl_multi_wait in order to easily handle all the async operations.
>
Sorry, not sure I understand.
Neither of those scenarios is an error, so curl_multi_info_read()
returns NULL when called right after curl_multi_exec() as show below:
$mc_handle = curl_multi_init();
$c = curl_init();
// Set up the handle and options
curl_multi_add_handle($mc_handle, $c);
do {
$cme = curl_multi_exec($mc_handle, $remain);
} while ($cme == CURLM_CALL_MULTI_PERFORM);
$rc = curl_multi_info_read($mc_handle); // This returns FALSE i.e.
NULL from the C library both when the connection was successful and
when it is still waiting.
> > We're currently using the 7.19.7 version of libcurl.
>
> This is quite old, and you’ll not be able to use curl_multi_wait (added in 7.28.0), but I see you are using curl_multi_select which probably do the job for you.
>
>
Neither curl_multi_wait() nor the 'older' function curl_multi_fdset()
exposes whether the internal file descriptor is ready for writes
(indicating a successful connection).
>
> HTH
>
>
>
> Yehezkel Horowitz
>
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-07-08