From 8a840469c3d1357b3f881c812185ede6ea71daa1 Mon Sep 17 00:00:00 2001
From: Zooko O'Whielacronx <zooko@zooko.com>
Date: Mon, 5 Jan 2009 13:35:22 -0700
Subject: [PATCH] immutable: tidy up the notification of waiters for
 ReadBucketProxy

---
 src/allmydata/immutable/layout.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

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)
-- 
2.45.2