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

From: Date: Tue, 13 Aug 2019 13:00:31 +0000
Subject: Bug #78404 [Opn->Csd]: Curl Multi Handle: curl_error($ch) returns no error string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222228@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: nikic@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: Closed Type: Bug Package: cURL related Operating System: Debian 8 PHP Version: 7.3.8 -Assigned To: +Assigned To: nikic Block user comment: N Private report: N New Comment: > I do not know why it worked in a previous php version. This used to work, because PHP handled errno + errstr inconsistently: Sometimes, the error string was available, even though the error number wasn't (like here). This was fixed to only provide the error string only if the error number is set, otherwise invalid error strings could persist in some cases. Unfortunately it broke this case :( > For me, you do not need to spent anymore time on this. I am going to wait for the next version > release of 7.3.0 and adapt my code. In that case I'm going to close this issue, as a fix for the curl_multi_info_read() variant is already in the pipeline... Previous Comments: ------------------------------------------------------------------------ [2019-08-13 11:53:57] sa dot su dot technic at gmail dot com For me it is sufficient to have the fix for bug #77946 and to change my code to call "curl_multi_info_read()." Thats fine. I do not know why it worked in a previous php version. For me, you do not need to spent anymore time on this. I am going to wait for the next version release of 7.3.0 and adapt my code. ------------------------------------------------------------------------ [2019-08-13 09:48:35] requinix@php.net So could this be a problem of mixing the Easy and Multi APIs in a way that cURL doesn't support? Or at least in a way it leaves as undefined behavior? The online docs talk about curl_multi_info_read being The Way to get the error messages: > To get information about completed transfers, to figure out success or not and similar, > curl_multi_info_read > should be called. It can return a message about a current or previous transfer. Repeated > invokes of the function > get more messages until the message queue is empty. The information you receive there includes > an easy handle > pointer which you may use to identify which easy handle the information regards. https://curl.haxx.se/libcurl/c/libcurl-multi.html And accordingly, while ($info = curl_multi_info_read($mh)) { echo curl_error($info['handle']) . PHP_EOL; } does produce error messages (on master). ------------------------------------------------------------------------ [2019-08-13 08:59:54] nikic@php.net I'm not sure what we should be doing here. As far as I understand, we can only get the errno information for the easy handles after calling curl_multi_info_read() -- unless I'm missing some other way? In that case, I believe that you need a) the fix for bug #77946 and b) change your code to call curl_multi_info_read() to make this work. ------------------------------------------------------------------------ [2019-08-13 06:17:25] sa dot su dot technic at gmail dot com Thats perfect! Thank you and your team very much!! I appreciate your work :-) ------------------------------------------------------------------------ [2019-08-13 05:54:46] requinix@php.net 7.2.22 and 7.3.9 - the upcoming releases. But the fix was specific to curl_multi_info_read(). ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=78404 -- Edit this bug report at https://bugs.php.net/bug.php?id=78404&edit=1

« previous php.bugs (#222228) next »