Bug #78404 [NEW]: Curl Multi Handle: curl_error($ch) returns no error string

From: Date: Mon, 12 Aug 2019 08:52:09 +0000
Subject: Bug #78404 [NEW]: Curl Multi Handle: curl_error($ch) returns no error string
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222188@lists.php.net to get a copy of this message
From:             sa dot su dot technic at gmail dot com
Operating system: Debian 8
PHP version:      7.3.8
Package:          *Network Functions
Bug Type:         Bug
Bug description:Curl Multi Handle: curl_error($ch) returns no error string

Description:
------------
As always in previous php versions there is no returned error string by
calling "curl_error($foo)" (e.g. "Port number out of range") when
executing curl multi handle.

Test script:
---------------
$ch1 = curl_init();
$ch2 = curl_init();
curl_setopt($ch1, CURLOPT_URL, "Foobar://127.0.0.1:777/foobar");
curl_setopt($ch2, CURLOPT_URL, "http://127.0.0.1:999999999/foobar");

$mh = curl_multi_init();
curl_multi_add_handle($mh,$ch1);
curl_multi_add_handle($mh,$ch2);
do {
    $status = curl_multi_exec($mh, $active);
    if ($active) {
        curl_multi_select($mh);
    }
} while ($active && $status == CURLM_OK);

echo curl_error($ch1) . PHP_EOL;
echo curl_error($ch2);

curl_multi_remove_handle($mh, $ch1);
curl_multi_remove_handle($mh, $ch2);
curl_multi_close($mh);

Expected result:
----------------
Output of "curl_error($ch1)":
Protocol "Foobar" not supported or disabled in libcurl

Output of "curl_error($ch2)":
Port number out of range



Actual result:
--------------
Output of "curl_error($ch1)":
Empty string

Output of "curl_error($ch2)":
Empty string

-- 
Edit bug report at https://bugs.php.net/bug.php?id=78404&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=78404&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=78404&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=78404&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=78404&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=78404&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=78404&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=78404&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=78404&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=78404&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=78404&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=78404&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=78404&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=78404&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=78404&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=78404&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=78404&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=78404&r=mysqlcfg



Thread (15 messages)

« previous php.bugs (#222188) next »