File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 3535
3636use GuzzleHttp \Exception \RequestException ;
3737use Icewind \Streams \IteratorDirectory ;
38+ use Icewind \Streams \RetryWrapper ;
3839
3940set_include_path (get_include_path ().PATH_SEPARATOR .
4041 \OC_App::getAppPath ('files_external ' ).'/3rdparty/google-api-php-client/src ' );
@@ -441,10 +442,9 @@ public function fopen($path, $mode) {
441442 // the library's service doesn't support streaming, so we use Guzzle instead
442443 $ client = \OC ::$ server ->getHTTPClientService ()->newClient ();
443444 try {
444- $ tmpFile = \OC ::$ server ->getTempManager ()->getTemporaryFile ($ ext );
445- $ client ->get ($ downloadUrl , [
445+ $ response = $ client ->get ($ downloadUrl , [
446446 'headers ' => $ httpRequest ->getRequestHeaders (),
447- 'save_to ' => $ tmpFile ,
447+ 'stream ' => true ,
448448 'verify ' => __DIR__ . '/../3rdparty/google-api-php-client/src/Google/IO/cacerts.pem ' ,
449449 ]);
450450 } catch (RequestException $ e ) {
@@ -459,7 +459,8 @@ public function fopen($path, $mode) {
459459 }
460460 }
461461
462- return fopen ($ tmpFile , 'r ' );
462+ $ handle = $ response ->getBody ();
463+ return RetryWrapper::wrap ($ handle );
463464 }
464465 }
465466 return false ;
You can’t perform that action at this time.
0 commit comments