Bug #78404 [Opn->Fbk]: Curl Multi Handle: curl_error($ch) returns no error string

From: Date: Mon, 12 Aug 2019 09:37:31 +0000
Subject: Bug #78404 [Opn->Fbk]: Curl Multi Handle: curl_error($ch) returns no error string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222189@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78404&edit=1 ID: 78404 Updated by: requinix@php.net Reported by: sa dot su dot technic at gmail dot com Summary: Curl Multi Handle: curl_error($ch) returns no error string -Status: Open +Status: Feedback Type: Bug Package: cURL related Operating System: Debian 8 PHP Version: 7.3.8 Block user comment: N Private report: N New Comment: What version of cURL are you using? Because this looks like an upstream matter. Between 7.58 and 7.64 (the two versions I have on hand) two things changed: 1. Errors during multi operations "bubble up" into the original handles 2. Port number error message was removed https://github.com/curl/curl/commit/46e1640#diff-8fb104c402dc51bdffef05a372f32aa2L3447 I modified your example to set CURLOPT_VERBOSE and mark the two messages with 1/2. On 7.64 on Windows I get * Expire in 0 ms for 6 (transfer 0x20d4a2f41c0) * Expire in 0 ms for 6 (transfer 0x20d4a2f9980) * Protocol "foobar" not supported or disabled in libcurl * Closing connection -1 * Closing connection -1 1: Protocol "foobar" not supported or disabled in libcurl 2: With 7.58 on Ubuntu 18.04 I get * Protocol "Foobar" not supported or disabled in libcurl * Closing connection -1 * Port number out of range * Closing connection -1 1: 2: Previous Comments: ------------------------------------------------------------------------ [2019-08-12 08:52:09] sa dot su dot technic at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=78404&edit=1

« previous php.bugs (#222189) next »