[Pkg-owncloud-commits] [owncloud] 63/205: Enable x-sendfile only if we do not lock the file system

David Prévot taffit at moszumanska.debian.org
Thu Jul 2 17:36:56 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit c74c8eff3a36b0d8130c1ee5ad95adfa7c46e5b8
Author: Thomas Müller <thomas.mueller at tmit.eu>
Date:   Mon Jun 22 12:07:53 2015 +0200

    Enable x-sendfile only if we do not lock the file system
---
 lib/private/files.php | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/private/files.php b/lib/private/files.php
index 90d83a1..d08cb3f 100644
--- a/lib/private/files.php
+++ b/lib/private/files.php
@@ -43,6 +43,7 @@
 // TODO: get rid of this using proper composer packages
 require_once 'mcnetic/phpzipstreamer/ZipStreamer.php';
 
+use OC\Lock\NoopLockingProvider;
 use OCP\Lock\ILockingProvider;
 
 /**
@@ -86,10 +87,13 @@ class OC_Files {
 	public static function get($dir, $files, $only_header = false) {
 		$view = \OC\Files\Filesystem::getView();
 		$xsendfile = false;
-		if (isset($_SERVER['MOD_X_SENDFILE_ENABLED']) ||
-			isset($_SERVER['MOD_X_SENDFILE2_ENABLED']) ||
-			isset($_SERVER['MOD_X_ACCEL_REDIRECT_ENABLED'])) {
-			$xsendfile = true;
+		if (\OC::$server->getLockingProvider() instanceof NoopLockingProvider) {
+			if (isset($_SERVER['MOD_X_SENDFILE_ENABLED']) ||
+				isset($_SERVER['MOD_X_SENDFILE2_ENABLED']) ||
+				isset($_SERVER['MOD_X_ACCEL_REDIRECT_ENABLED'])
+			) {
+				$xsendfile = true;
+			}
 		}
 
 		if (is_array($files) && count($files) === 1) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list