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:
2e15c9a
)
storageserver: the last segment is not always going to be the same size as the rest...
author
Brian Warner
<warner@allmydata.com>
Tue, 17 Apr 2007 20:41:45 +0000
(13:41 -0700)
committer
Brian Warner
<warner@allmydata.com>
Tue, 17 Apr 2007 20:41:45 +0000
(13:41 -0700)
src/allmydata/storageserver.py
patch
|
blob
|
history
diff --git
a/src/allmydata/storageserver.py
b/src/allmydata/storageserver.py
index 136c5dc56402e2ea88838f7ba6b0372f420697dd..1cdea75aff56cb48beb341bf7f5d8d135701e501 100644
(file)
--- a/
src/allmydata/storageserver.py
+++ b/
src/allmydata/storageserver.py
@@
-38,7
+38,10
@@
class BucketWriter(Referenceable):
def remote_put_block(self, segmentnum, data):
precondition(not self.closed)
- assert len(data) == self.blocksize
+ # all blocks but the last will be of size self.blocksize, however the
+ # last one may be short, and we don't know the total number of
+ # segments so we can't tell which is which.
+ assert len(data) <= self.blocksize
f = open(os.path.join(self.incominghome, 'data'), 'wb')
f.seek(self.blocksize*segmentnum)
f.write(data)