mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-21 10:01:54 +00:00
storage.py: assert that immutable share size will fit in the 4-byte v1 container (see #346). The struct module in py2.4 raises an error on overflow, but py2.5 merely emits a warning
This commit is contained in:
parent
c08b0eb1ea
commit
0832334c0d
@ -236,6 +236,7 @@ class BucketWriter(Referenceable):
|
||||
fileutil.make_dirs(os.path.dirname(incominghome))
|
||||
# Also construct the metadata.
|
||||
f = open(incominghome, 'wb')
|
||||
precondition(size < 2**32) # v1 container format: 4-byte size field
|
||||
f.write(struct.pack(">LLL", 1, size, 0))
|
||||
f.close()
|
||||
self._sharefile = ShareFile(incominghome)
|
||||
|
Loading…
x
Reference in New Issue
Block a user