]> source.dussan.org Git - nextcloud-server.git/commitdiff
Merge pull request #2885 from FlorinPeter/files_encryption
authorSam Tuke <mail@samtuke.com>
Tue, 16 Apr 2013 11:25:59 +0000 (04:25 -0700)
committerSam Tuke <mail@samtuke.com>
Tue, 16 Apr 2013 11:25:59 +0000 (04:25 -0700)
fix performance issues

1  2 
apps/files_encryption/lib/stream.php

index 7315245fcce1ef306e04d2607d7f3a4894ff23f2,dcc12c9f9ead8a300c8781639e2b8ae25344a336..ebfd05041ba2d2b6bafc8dfd8060cdc3c3d00e8b
@@@ -224,9 -224,14 +224,14 @@@ class Stream 
         */
        public function getKey() {
                
+         // fix performance issues
+         if(isset($this->keyfile) && isset($this->encKeyfile)) {
+             return true;
+         }
+         
                // If a keyfile already exists for a file named identically to 
                // file to be written
 -              if ( $this->rootView->file_exists( $this->userId . '/'. 'files_encryption' . '/' . 'keyfiles' . '/' . $this->rawPath . '.key' ) ) {
 +              if ( $this->rootView->file_exists( $this->userId . '/'. 'files_encryption' . '/' . 'keyfiles' . '/' . $this->relPath . '.key' ) ) {
                
                        // TODO: add error handling for when file exists but no 
                        // keyfile