From cd4d3cdeeacca0aa9f82ff2c7d952f3377a7bd36 Mon Sep 17 00:00:00 2001
From: Brian Warner <warner@lothar.com>
Date: Mon, 28 Jul 2008 14:57:31 -0700
Subject: [PATCH] download.py: set up self._paused before registering the
 producer, since they might call pauseProducing right away

---
 src/allmydata/immutable/download.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/allmydata/immutable/download.py b/src/allmydata/immutable/download.py
index cdc210c5..878d38d0 100644
--- a/src/allmydata/immutable/download.py
+++ b/src/allmydata/immutable/download.py
@@ -456,13 +456,13 @@ class FileDownloader:
         self._results.timings["cumulative_decrypt"] = 0.0
         self._results.timings["paused"] = 0.0
 
+        self._paused = False
+        self._stopped = False
         if IConsumer.providedBy(downloadable):
             downloadable.registerProducer(self, True)
         self._downloadable = downloadable
         self._output = Output(downloadable, u.key, self._size, self._log_number,
                               self._status)
-        self._paused = False
-        self._stopped = False
 
         self.active_buckets = {} # k: shnum, v: bucket
         self._share_buckets = [] # list of (sharenum, bucket) tuples
-- 
2.45.2