Bug #69607 [Opn]: curl_multi_select returns -1 for error or non error condition.

From: Date: Sun, 24 Apr 2016 03:58:57 +0000
Subject: Bug #69607 [Opn]: curl_multi_select returns -1 for error or non error condition.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200733@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69607&edit=1

 ID:                 69607
 Updated by:         pierrick@php.net
 Reported by:        daniel dot pitts at cbsinteractive dot com
 Summary:            curl_multi_select returns -1 for error or non error
                     condition.
 Status:             Open
 Type:               Bug
 Package:            cURL related
 Operating System:   All
 PHP Version:        Irrelevant
-Assigned To:        
+Assigned To:        pierrick
 Block user comment: N
 Private report:     N

 New Comment:

I started a patch that implement two new functions :

curl_multi_errno and curl_multi_strerror.

In your case you'll have to do curl_multi_strerror(curl_multi_errno($cmh));
This patch should be committed in PHP7.1


Previous Comments:
------------------------------------------------------------------------
[2015-05-08 17:10:55] daniel dot pitts at cbsinteractive dot com

Description:
------------
curl_multi_select returns -1 for error or non error condition.

If the underlying 'curl_multi_fdset' sets the max_fd to -1, curl_multi_select returns -1. 
That isn't an error condition, but a 'please call curl_multi_perform soon' signal.  

If the underlying call to 'select' returns error (-1), then it is an error condition.
Unfortunately there is no way from the PHP code to find out if select reported an error, or if the
multi_fdset reported max_fd = -1.  

It would be useful if curl_multi_select at least set some value somewhere that would let us know
that the select failed, preferably with info from errno.

  $result = curl_multi_select($cmh);
  if ($result === -1) {
     $err = curl_multi_select_last_error($cmh); // missing this function.
     if ($err) {
        throw new \Exception($err);
     }
  }





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



--
Edit this bug report at https://bugs.php.net/bug.php?id=69607&edit=1


Thread (3 messages)

« previous php.bugs (#200733) next »