From: jenkins-bot Date: Wed, 9 Aug 2017 18:15:43 +0000 (+0000) Subject: Merge "FileRepo: create output buffer and set ob_implicit_flush for file streaming" X-Git-Tag: 1.31.0-rc.0~2436 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=953667476d69cc503246ba7816d2bb0bb7f41e77;hp=055780106a1d863c936850501fc51894f816ee27 Merge "FileRepo: create output buffer and set ob_implicit_flush for file streaming" --- diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index f89d96b218..dc36e50a1e 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -1602,9 +1602,15 @@ class FileRepo { $path = $this->resolveToStoragePath( $virtualUrl ); $params = [ 'src' => $path, 'headers' => $headers, 'options' => $optHeaders ]; + // T172851: HHVM does not flush the output properly, causing OOM + ob_start( NULL, 1048576 ); + ob_implicit_flush( true ); + $status = $this->newGood(); $status->merge( $this->backend->streamFile( $params ) ); + ob_end_flush(); + return $status; }