]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Tue Jun 12 02:16:02 BST 2012 Brian Warner <warner@lothar.com>
authorDaira Hopwood <daira@jacaranda.org>
Thu, 5 Sep 2013 16:46:33 +0000 (17:46 +0100)
committerDaira Hopwood <daira@jacaranda.org>
Thu, 5 Sep 2013 16:46:33 +0000 (17:46 +0100)
  * offloaded.py: don't drop the Deferred

  There was one corner case (where the client disconnects at just the
  wrong time) that could have dropped a Deferred, leading to an Unhandled
  Error. Clean up the control flow to avoid this case.

src/allmydata/immutable/offloaded.py

index 02b1386e41f0a20a8d197c40074ebd2030dd036d..017dd2a4694ca87d9d15500d7df0df246e71fd0c 100644 (file)
@@ -311,14 +311,12 @@ class CHKCiphertextFetcher(AskUntilSuccessMixin):
             # else.
             have = os.stat(self._encoding_file)[stat.ST_SIZE]
             d = self.call("read_encrypted", have-1, 1)
-            d.addCallback(self._done2, started)
-            return
-
-        # first, find out how large the file is going to be
-        d = self.call("get_size")
-        d.addCallback(self._got_size)
-        d.addCallback(self._start_reading)
-        d.addCallback(self._done)
+        else:
+            # first, find out how large the file is going to be
+            d = self.call("get_size")
+            d.addCallback(self._got_size)
+            d.addCallback(self._start_reading)
+            d.addCallback(self._done)
         d.addCallback(self._done2, started)
         d.addErrback(self._failed)