Skip to content

Commit

Permalink
Do not yield output, the AsyncServer API does not expect any value
Browse files Browse the repository at this point in the history
...but it might, see xp-framework/networking#28
  • Loading branch information
thekid committed Dec 3, 2023
1 parent 968b8de commit 3e8c701
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/php/web/handler/FilesFrom.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private function copy($out, $file, $range) {

$length= $range->length();
while ($length && $chunk= $file->read(min(self::CHUNKSIZE, $length))) {
yield 'write' => $out;
yield 'write' => null;
$out->write($chunk);
$length-= strlen($chunk);
}
Expand Down Expand Up @@ -129,7 +129,7 @@ public function serve($request, $response, $target, $mimeType= null) {
$file->open(File::READ);
try {
do {
yield 'write' => $out;
yield 'write' => null;
$out->write($file->read(self::CHUNKSIZE));
} while (!$file->eof());
} finally {
Expand Down

0 comments on commit 3e8c701

Please sign in to comment.