projects
/
tahoe-lafs
/
tahoe-lafs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
98b28c1
)
immutable: raise a LayoutInvalid exception instead of an AssertionError if the share...
author
Zooko O'Whielacronx
<zooko@zooko.com>
Mon, 5 Jan 2009 21:01:14 +0000
(14:01 -0700)
committer
Zooko O'Whielacronx
<zooko@zooko.com>
Mon, 5 Jan 2009 21:01:14 +0000
(14:01 -0700)
src/allmydata/immutable/layout.py
patch
|
blob
|
history
diff --git
a/src/allmydata/immutable/layout.py
b/src/allmydata/immutable/layout.py
index 07d1131f77eacc2dcbe570c2bf4189f81afcfb15..8ab6e1dbae0ef535f1a11cdc5cc0bc3f5afe1a10 100644
(file)
--- a/
src/allmydata/immutable/layout.py
+++ b/
src/allmydata/immutable/layout.py
@@
-414,7
+414,8
@@
class ReadBucketProxy:
end of the share, so we need to use the offset and read just that much."""
offset = self._offsets['share_hashes']
size = self._offsets['uri_extension'] - offset
- assert size % (2+HASH_SIZE) == 0
+ if size % (2+HASH_SIZE) != 0:
+ raise LayoutInvalid("share hash tree corrupted -- should occupy a multiple of %d bytes, not %d bytes" % ((2+HASH_SIZE), size))
d = self._read(offset, size)
def _unpack_share_hashes(data):
assert len(data) == size