Browse Source

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>
pull/3157/head
Vincent Petry 9 years ago
committed by Robin Appelman
parent
commit
0aaf209c66
No known key found for this signature in database GPG Key ID: 50F2B59C6DEBBCFE
  1. 1
      apps/dav/appinfo/v1/webdav.php
  2. 1
      apps/dav/appinfo/v2/remote.php
  3. 2
      lib/private/Files/View.php
  4. 1
      lib/private/legacy/files.php

1
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();

1
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();

2
lib/private/Files/View.php

@ -1146,6 +1146,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);

1
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;

Loading…
Cancel
Save