diff options
author | Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com> | 2023-09-06 09:16:55 +0200 |
---|---|---|
committer | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2023-09-07 09:32:32 +0200 |
commit | 003d0dec9342e984d2a35acc4cca4e8eaa9778a1 (patch) | |
tree | 2bd2d02889d52e5d41fdf1276b41f704918f324c /lib/private/legacy | |
parent | 80a4b369f8831980d81da9e2396fe4c6977b6323 (diff) | |
download | nextcloud-server-003d0dec9342e984d2a35acc4cca4e8eaa9778a1.tar.gz nextcloud-server-003d0dec9342e984d2a35acc4cca4e8eaa9778a1.zip |
Detect aborted connection in OC\Files\View and stop writing data to the output buffer
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Diffstat (limited to 'lib/private/legacy')
-rw-r--r-- | lib/private/legacy/OC_Files.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/legacy/OC_Files.php b/lib/private/legacy/OC_Files.php index 7bc1fab94b6..911c713f840 100644 --- a/lib/private/legacy/OC_Files.php +++ b/lib/private/legacy/OC_Files.php @@ -230,6 +230,10 @@ class OC_Files { OC::$server->getLogger()->logException($ex); $l = \OC::$server->getL10N('lib'); \OC_Template::printErrorPage($l->t('Cannot download file'), $ex->getMessage(), 200); + } catch (\OCP\Files\ConnectionLostException $ex) { + self::unlockAllTheFiles($dir, $files, $getType, $view, $filename); + OC::$server->getLogger()->logException($ex, ['level' => \OCP\ILogger::DEBUG]); + \OC_Template::printErrorPage('Connection lost', $ex->getMessage(), 200); } catch (\Exception $ex) { self::unlockAllTheFiles($dir, $files, $getType, $view, $filename); OC::$server->getLogger()->logException($ex); |