summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorVictor Shyba <victor.shyba@gmail.com>2014-11-11 14:09:15 -0200
committerVictor Shyba <victor.shyba@gmail.com>2014-11-11 14:09:15 -0200
commit6fde0d61a8b0c549efb14a83ad9e39efec4a2887 (patch)
tree3c8b016696c891af88d9fbb7052ee3bf0bed0b19 /service
parent0d7313c01193b00ce3d65c4b54e6a3c6633de7ad (diff)
update length cache on open file #71
Diffstat (limited to 'service')
-rw-r--r--service/pixelated/support/encrypted_file_storage.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/service/pixelated/support/encrypted_file_storage.py b/service/pixelated/support/encrypted_file_storage.py
index 95785baa..b9871ace 100644
--- a/service/pixelated/support/encrypted_file_storage.py
+++ b/service/pixelated/support/encrypted_file_storage.py
@@ -45,4 +45,5 @@ class EncryptedFileStorage(FileStorage):
def _open_encrypted_file(self, name, onclose=lambda x: None):
file_content = open(self._fpath(name), "rb").read()
decrypted = self.f.decrypt(file_content)
+ self.length_cache[name] = len(decrypted)
return BufferFile(buffer(decrypted), name=name, onclose=onclose)