php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77946 Bad cURL resources returned by curl_multi_info_read()
Submitted: 2019-04-27 12:12 UTC Modified: -
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: phansys at gmail dot com Assigned:
Status: Open Package: cURL related
PHP Version: 7.3.4 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-04-27 12:12 UTC] 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


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-04-27 13:19 UTC]
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-29 20:56 UTC] 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-06-05 06:52 UTC] toni dot ertl at check24 dot de
happens also with version 7.2.19
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Jun 18 09:01:27 2019 UTC