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

From: Date: Tue, 13 Aug 2019 11:53:57 +0000
Subject: Bug #78404 [Opn]: Curl Multi Handle: curl_error($ch) returns no error string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222226@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
 User updated by:    sa dot su dot technic at gmail dot com
 Reported by:        sa dot su dot technic at gmail dot com
 Summary:            Curl Multi Handle: curl_error($ch) returns no error
                     string
 Status:             Open
 Type:               Bug
 Package:            cURL related
 Operating System:   Debian 8
 PHP Version:        7.3.8
 Block user comment: N
 Private report:     N

 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------
[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().

------------------------------------------------------------------------
[2019-08-13 05:42:28] sa dot su dot technic at gmail dot com

In the related bug report https://bugs.php.net/bug.php?id=77946 I can see
that there is a fix commit for this bug.
But I was not able to see for which php version. Thank you!

------------------------------------------------------------------------


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


Thread (15 messages)

« previous php.bugs (#222226) next »