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

From: Date: Tue, 13 Aug 2019 09:48:35 +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-222223@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
 Type:               Bug
 Package:            cURL related
 Operating System:   Debian 8
 PHP Version:        7.3.8
 Block user comment: N
 Private report:     N

 New Comment:

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).


Previous Comments:
------------------------------------------------------------------------
[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!

------------------------------------------------------------------------
[2019-08-13 05:09:00] requinix@php.net

I believe we have all the information necessary so there's nothing else you need to do. If this
is a bug in PHP (seems like it) then it will be fixed when it can be identified and fixed. And yes,
it should be possible to do for both PHP 7.2 and 7.3, whose next set of releases will be in about
two weeks.

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


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 (#222223) next »