Commit 4fcffcf3 authored by Vincent Petry's avatar Vincent Petry Committed by GitHub
Browse files

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
parent a4883ae7
......@@ -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();
......
......@@ -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();
......
......@@ -1143,6 +1143,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);
......
......@@ -147,6 +147,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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment