From 7efce841283bade49e447b66f9821f3b85b04f7c Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 14 Dec 2023 17:10:47 +0100 Subject: [PATCH] Use getOutputBufferStream --- src/MTProtoTools/FilesLogic.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/MTProtoTools/FilesLogic.php b/src/MTProtoTools/FilesLogic.php index aaa2999e6..d35befd79 100644 --- a/src/MTProtoTools/FilesLogic.php +++ b/src/MTProtoTools/FilesLogic.php @@ -59,6 +59,7 @@ use const FILTER_VALIDATE_URL; use function Amp\async; use function Amp\ByteStream\buffer; +use function Amp\ByteStream\getOutputBufferStream; use function Amp\File\exists; use function Amp\File\getSize; @@ -130,7 +131,7 @@ trait FilesLogic ob_implicit_flush(); } [$start, $end] = $result->getServeRange(); - $this->downloadToStream($messageMedia, fopen('php://output', 'w'), $cb, $start, $end, $cancellation); + $this->downloadToStream($messageMedia, getOutputBufferStream(), $cb, $start, $end, $cancellation); } } /**