Bug #77946 [Com]: Bad cURL resources returned by curl_multi_info_read()

From: Date: Wed, 05 Jun 2019 06:52:37 +0000
Subject: Bug #77946 [Com]: Bad cURL resources returned by curl_multi_info_read()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-221126@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77946&edit=1 ID: 77946 Comment by: toni dot ertl at check24 dot de Reported by: phansys at gmail dot com Summary: Bad cURL resources returned by curl_multi_info_read() Status: Open Type: Bug Package: cURL related PHP Version: 7.3.4 Block user comment: N Private report: N New Comment: happens also with version 7.2.19 Previous Comments: ------------------------------------------------------------------------ [2019-04-29 20:56:14] phansys at gmail dot com This issue seems to be a duplicate of https://bugs.php.net/bug.php?id=60660, which is currently in "Bogus" status. ------------------------------------------------------------------------ [2019-04-27 13:19:07] The following pull request has been associated: Patch Name: [cURL] [bug#77946] Add test for curl_multi_info_read() On GitHub: https://github.com/php/php-src/pull/4075 Patch: https://github.com/php/php-src/pull/4075.patch ------------------------------------------------------------------------ [2019-04-27 12:12:28] phansys at gmail dot com Description: ------------ cURL resources returned by curl_multi_info_read() aren't usables with curl_errno() or curl_errno(). When an error occurs with these resources, the "handle" returned doesn't behave as a single handle. I've created a draft PR with a test exposing the problem: https://github.com/php/php-src/pull/4075 Test script: --------------- $urls = array( 'http://nonexistent.tld', ); $mh = curl_multi_init(); foreach ($urls as $i => $url) { $conn[$i] = curl_init($url); curl_multi_add_handle($mh, $conn[$i]); } do { $status = curl_multi_exec($mh, $active); $info = curl_multi_info_read($mh); if (false !== $info) { echo $info['result']."\n"; echo curl_errno($info['handle'])."\n"; echo curl_error($info['handle'])."\n"; } } while ($status === CURLM_CALL_MULTI_PERFORM || $active); foreach ($urls as $i => $url) { curl_close($conn[$i]); } curl_multi_close($mh); Expected result: ---------------- 6 6 Could not resolve host: nonexistent.tld Actual result: -------------- 6 0 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77946&edit=1

« previous php.bugs (#221126) next »