From 2e5e756913ffcc62ada6303e6d85dc0192a51eba Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 12 Jan 2016 13:14:04 +0100 Subject: cap the number of entries we cache in smb's statcache --- apps/files_external/lib/smb.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'apps/files_external/lib/smb.php') diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php index f58cd9849f2..f0052c817ce 100644 --- a/apps/files_external/lib/smb.php +++ b/apps/files_external/lib/smb.php @@ -35,6 +35,7 @@ use Icewind\SMB\NativeServer; use Icewind\SMB\Server; use Icewind\Streams\CallbackWrapper; use Icewind\Streams\IteratorDirectory; +use OC\Cache\CappedMemoryCache; use OC\Files\Filesystem; class SMB extends Common { @@ -48,10 +49,15 @@ class SMB extends Common { */ protected $share; + /** + * @var string + */ + protected $root; + /** * @var \Icewind\SMB\FileInfo[] */ - protected $statCache = array(); + protected $statCache; public function __construct($params) { if (isset($params['host']) && isset($params['user']) && isset($params['password']) && isset($params['share'])) { @@ -72,6 +78,7 @@ class SMB extends Common { } else { throw new \Exception('Invalid configuration'); } + $this->statCache = new CappedMemoryCache(); } /** -- cgit v1.2.3