A-Bran пре 2 недеља
родитељ
комит
41df59e6ea
No account linked to committer's email address
1 измењених фајлова са 11 додато и 0 уклоњено
  1. 11
    0
      lib/private/Streamer.php

+ 11
- 0
lib/private/Streamer.php Прегледај датотеку

@@ -28,6 +28,7 @@
*/
namespace OC;

use Icewind\Streams\CallbackWrapper;
use OC\Files\Filesystem;
use OCP\Files\File;
use OCP\Files\Folder;
@@ -127,6 +128,7 @@ class Streamer {
/** @var LoggerInterface $logger */
$logger = \OC::$server->query(LoggerInterface::class);
foreach ($files as $file) {
if(connection_status() !== CONNECTION_NORMAL) return;
if ($file instanceof File) {
try {
$fh = $file->fopen('r');
@@ -162,6 +164,15 @@ class Streamer {
* @return bool $success
*/
public function addFileFromStream($stream, string $internalName, int|float $size, $time): bool {
if(connection_status() !== CONNECTION_NORMAL) return false;
// Close file-stream when user-connection closed
$stream = CallbackWrapper::wrap($stream,
function ($count) use ($stream) {
if (connection_status() !== CONNECTION_NORMAL) {
fclose($stream);
}
});

$options = [];
if ($time) {
$options = [

Loading…
Откажи
Сачувај