Commit 16802d05 authored by Lucas Carvalho's avatar Lucas Carvalho

Increasing the block size for 1Mb.

Just a small performance improvement, the behavior still the same.
Because when the client send a big file, it should not take too long to check the sha512 sum.
parent 1004c3ec
...@@ -71,7 +71,7 @@ def WebSection_setObject(self, id, ob, **kw): ...@@ -71,7 +71,7 @@ def WebSection_setObject(self, id, ob, **kw):
sha512sum = hashlib.sha512() sha512sum = hashlib.sha512()
self.REQUEST._file.seek(0) self.REQUEST._file.seek(0)
while True: while True:
d = self.REQUEST._file.read(sha512sum.block_size) d = self.REQUEST._file.read(1<<20)
if not d: if not d:
break break
sha512sum.update(d) sha512sum.update(d)
......
46 47
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment