diff --git a/apps/dav/appinfo/v1/webdav.php b/apps/dav/appinfo/v1/webdav.php index 2475451614af..6c198ce4ff11 100644 --- a/apps/dav/appinfo/v1/webdav.php +++ b/apps/dav/appinfo/v1/webdav.php @@ -24,6 +24,7 @@ // no php execution timeout for webdav set_time_limit(0); +ignore_user_abort(true); // Turn off output buffering to prevent memory problems \OC_Util::obEnd(); diff --git a/apps/dav/appinfo/v2/remote.php b/apps/dav/appinfo/v2/remote.php index 5f1f0d03e4f7..8e4f003875bd 100644 --- a/apps/dav/appinfo/v2/remote.php +++ b/apps/dav/appinfo/v2/remote.php @@ -21,6 +21,7 @@ */ // no php execution timeout for webdav set_time_limit(0); +ignore_user_abort(true); // Turn off output buffering to prevent memory problems \OC_Util::obEnd(); diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 0f7b6a124528..87acb948ac8b 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1143,6 +1143,8 @@ private function basicOperation($operation, $path, $hooks = [], $extraParam = nu $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 728833803155..d9fd41f0683c 100644 --- a/lib/private/legacy/files.php +++ b/lib/private/legacy/files.php @@ -147,6 +147,7 @@ public static function get($dir, $files, $params = null) { $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;