diff --git a/src/Curl/Curl.php b/src/Curl/Curl.php index c5776d7..e9d6e81 100644 --- a/src/Curl/Curl.php +++ b/src/Curl/Curl.php @@ -385,6 +385,11 @@ class Curl $this->call($this->completeFunction); + // Close open file handles and reset the curl instance. + if (!($this->fileHandle === null)) { + $this->downloadComplete($this->fileHandle); + } + return $this->response; } diff --git a/src/Curl/MultiCurl.php b/src/Curl/MultiCurl.php index 28c226d..9e43d5f 100644 --- a/src/Curl/MultiCurl.php +++ b/src/Curl/MultiCurl.php @@ -543,11 +543,6 @@ class MultiCurl $ch->exec($ch->curl); curl_multi_remove_handle($this->multiCurl, $ch->curl); unset($this->curls[$key]); - - // Close open file handles and reset the curl instance. - if (!($ch->fileHandle === null)) { - $ch->downloadComplete($ch->fileHandle); - } break; } }