Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2017-01-13 14:55:08 +0300
committerRobin Appelman <robin@icewind.nl>2017-04-25 15:11:38 +0300
commite47d8028dcb26dc50fe61f8e08e0c2c5a8054dc2 (patch)
tree311682cff2931d4368fb20d223b9616581fd318a /lib/private
parentba776a3c0faf1c00aaf2b6d54e391b8feaad2b50 (diff)
Prevent PHP request to get killed when using fclose callback (#26775)
* Prevent PHP request to get killed when using fclose callback * Add ignore_user_abort everywhere where the time limit is set to 0 Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Files/View.php2
-rw-r--r--lib/private/legacy/files.php1
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index 6facc7b9462..274ebed05c3 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -1149,6 +1149,8 @@ class View {
$unlockLater = false;
if ($this->lockingEnabled && $operation === 'fopen' && is_resource($result)) {
$unlockLater = true;
+ // make sure our unlocking callback will still be called if connection is aborted
+ ignore_user_abort(true);
$result = CallbackWrapper::wrap($result, null, null, function () use ($hooks, $path) {
if (in_array('write', $hooks)) {
$this->unlockFile($path, ILockingProvider::LOCK_EXCLUSIVE);
diff --git a/lib/private/legacy/files.php b/lib/private/legacy/files.php
index b6c6857a1bf..8c9adad0d49 100644
--- a/lib/private/legacy/files.php
+++ b/lib/private/legacy/files.php
@@ -148,6 +148,7 @@ class OC_Files {
$streamer->sendHeaders($name);
$executionTime = intval(OC::$server->getIniWrapper()->getNumeric('max_execution_time'));
set_time_limit(0);
+ ignore_user_abort(true);
if ($getType === self::ZIP_FILES) {
foreach ($files as $file) {
$file = $dir . '/' . $file;