From 78f4a1eae9358cf99938cac8d36136abef2da728 Mon Sep 17 00:00:00 2001 From: HFO4 <912394456@qq.com> Date: Thu, 13 Sep 2018 17:07:51 +0800 Subject: [PATCH] fix: failed to close file stream in onedrive policy --- extend/Krizalys/Onedrive/Client.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extend/Krizalys/Onedrive/Client.php b/extend/Krizalys/Onedrive/Client.php index 18f1fb0c..3a8e0dbd 100644 --- a/extend/Krizalys/Onedrive/Client.php +++ b/extend/Krizalys/Onedrive/Client.php @@ -592,7 +592,9 @@ class Client public function sendFileChunk($url,$headers,$stream){ $curl = self::_createCurl(""); + $close = 0; if(!is_resource($stream)){ + $close = 1; $options=[]; $options = array_merge([ 'stream_back_end' => $this->_streamBackEnd, @@ -629,7 +631,7 @@ class Client curl_setopt_array($curl, $options); $data = $this->_processResult($curl); - if (!is_resource($content)) { + if (is_resource($close)) { fclose($stream); } return $data;