diff --git a/apps/dav/appinfo/v1/webdav.php b/apps/dav/appinfo/v1/webdav.php index f04bf40633459..5ad11ceada86c 100644 --- a/apps/dav/appinfo/v1/webdav.php +++ b/apps/dav/appinfo/v1/webdav.php @@ -25,6 +25,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 ab05e376503d9..b4a6578a41a8f 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 909c49197b8ec..db21d400b39ea 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1146,6 +1146,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 b6c6857a1bfaa..8c9adad0d4986 100644 --- a/lib/private/legacy/files.php +++ b/lib/private/legacy/files.php @@ -148,6 +148,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;