From: Zooko O'Whielacronx Date: Mon, 5 Jan 2009 20:35:22 +0000 (-0700) Subject: immutable: tidy up the notification of waiters for ReadBucketProxy X-Git-Url: https://git.rkrishnan.org/FOOURL?a=commitdiff_plain;h=8a840469c3d1357b3f881c812185ede6ea71daa1;p=tahoe-lafs%2Ftahoe-lafs.git immutable: tidy up the notification of waiters for ReadBucketProxy --- diff --git a/src/allmydata/immutable/layout.py b/src/allmydata/immutable/layout.py index d1c2da45..f64b388f 100644 --- a/src/allmydata/immutable/layout.py +++ b/src/allmydata/immutable/layout.py @@ -289,7 +289,9 @@ class ReadBucketProxy: d.addCallback(self._parse_sharehashtree_and_ueb) def _fail_waiters(f): self._ready.fire(f) - d.addErrback(_fail_waiters) + def _notify_waiters(result): + self._ready.fire(result) + d.addCallbacks(_notify_waiters, _fail_waiters) return d def _fetch_header(self): @@ -351,8 +353,6 @@ class ReadBucketProxy: length = struct.unpack(self._fieldstruct, data[i:i+self._fieldsize])[0] self._ueb_data = data[i+self._fieldsize:i+self._fieldsize+length] - self._ready.fire(self) - def _get_block_data(self, unused, blocknum, blocksize, thisblocksize): offset = self._offsets['data'] + blocknum * blocksize return self._read(offset, thisblocksize)