mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-30 04:01:47 +00:00
Add warning against using error code from curl_errno() for multi handles
This commit is contained in:
@@ -536,6 +536,9 @@ class MultiCurl
|
||||
if ($info_array['msg'] === CURLMSG_DONE) {
|
||||
foreach ($this->curls as $key => $ch) {
|
||||
if ($ch->curl === $info_array['handle']) {
|
||||
// Set the error code for multi handles using the "result" key in the array returned by
|
||||
// curl_multi_info_read(). Using curl_errno() on a multi handle will incorrectly return 0
|
||||
// for errors.
|
||||
$ch->curlErrorCode = $info_array['result'];
|
||||
$ch->exec($ch->curl);
|
||||
curl_multi_remove_handle($this->multiCurl, $ch->curl);
|
||||
|
||||
Reference in New Issue
Block a user