From b907159c2f006249c2d3df087d0658acc1ae2bcf Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Fri, 2 Sep 2016 01:30:16 -0700 Subject: [PATCH] Move download complete handling to Curl::exec() --- src/Curl/Curl.php | 5 +++++ src/Curl/MultiCurl.php | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) 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; } }