diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-28 10:21:26 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-28 10:21:26 +0100 |
commit | 24271cf95358b294180f2cec80a0f71733b9e250 (patch) | |
tree | 912642e4238531f2c2002e4bd26bdb2271a736d3 /apps | |
parent | eb509bcbe6d6b97133a7b4dfba81325e92500aed (diff) | |
parent | 667d7383e159d12102d2bf519ca2215681865aa9 (diff) | |
download | nextcloud-server-24271cf95358b294180f2cec80a0f71733b9e250.tar.gz nextcloud-server-24271cf95358b294180f2cec80a0f71733b9e250.zip |
Merge pull request #21216 from owncloud/fopen-statcache
Clear SMB statcache after fopen
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_external/lib/smb.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php index a94840ead59..80b44a4cbdf 100644 --- a/apps/files_external/lib/smb.php +++ b/apps/files_external/lib/smb.php @@ -33,6 +33,7 @@ use Icewind\SMB\Exception\Exception; use Icewind\SMB\Exception\NotFoundException; use Icewind\SMB\NativeServer; use Icewind\SMB\Server; +use Icewind\Streams\CallbackWrapper; use Icewind\Streams\IteratorDirectory; use OC\Files\Filesystem; @@ -189,7 +190,10 @@ class SMB extends Common { return $this->share->read($fullPath); case 'w': case 'wb': - return $this->share->write($fullPath); + $source = $this->share->write($fullPath); + return CallBackWrapper::wrap($source, null, null, function () use ($fullPath) { + unset($this->statCache[$fullPath]); + }); case 'a': case 'ab': case 'r+': @@ -219,7 +223,8 @@ class SMB extends Common { } $source = fopen($tmpFile, $mode); $share = $this->share; - return CallBackWrapper::wrap($source, null, null, function () use ($tmpFile, $fullPath, $share) { + return CallbackWrapper::wrap($source, null, null, function () use ($tmpFile, $fullPath, $share) { + unset($this->statCache[$fullPath]); $share->put($tmpFile, $fullPath); unlink($tmpFile); }); |