Add warning against using error code from curl_errno() for multi handles

This commit is contained in:
Zach Borboa
2016-08-31 23:31:32 -07:00
parent 6dc65e994c
commit 6e636f02c8
+3
View File
@@ -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);