In download_bt1.py, the torrentdata parameter of shutdown() uses
the default value, which is reused for subsequent calls.  This
shared object gets stored in the cache, so subsequent calls to
shutdown() overwrite the data already in the cache.

There's a patch attached, but it needs to wait for a couple more
mirror updates, so I can test it properly.

Steve
Sun Jun 29 16:27:18 BST 2008  Steve Cotton <[EMAIL PROTECTED]>
  * #487829 upload / download stats get mixed up
diff -rN -u old-debtorrent/debian/changelog new-debtorrent/debian/changelog
--- old-debtorrent/debian/changelog	2008-06-29 18:50:33.000000000 +0100
+++ new-debtorrent/debian/changelog	2008-06-29 18:50:33.000000000 +0100
@@ -1,3 +1,10 @@
+debtorrent (0.1.8.steve2.1) norelease; urgency=low
+
+  * Fix: download / upload stats are correct after
+    restarting torrents (Closes: #487829)
+
+ -- Steve Cotton <[EMAIL PROTECTED]>  Sun, 29 Jun 2008 16:22:40 +0100
+
 debtorrent (0.1.8) unstable; urgency=low
 
   * Fix: stopping long-lived torrents will not prevent new torrents from
diff -rN -u old-debtorrent/DebTorrent/download_bt1.py new-debtorrent/DebTorrent/download_bt1.py
--- old-debtorrent/DebTorrent/download_bt1.py	2008-06-29 18:50:33.000000000 +0100
+++ new-debtorrent/DebTorrent/download_bt1.py	2008-06-29 18:50:33.000000000 +0100
@@ -1308,17 +1308,16 @@
         return self.encoder
 
 
-    def shutdown(self, torrentdata = {}):
+    def shutdown(self):
         """Shutdown the running download.
         
-        @type torrentdata: C{dictionary}
-        @param torrentdata: any data that needs to be saved (pickled)
         @rtype: C{boolean}
         @return: False if a failure or exception occurred
         
         """
-        
+
         logger.info('Download shutdown')
+        torrentdata = {}
         if self.checking or self.started:
             self.storagewrapper.sync()
             self.storage.close()

Reply via email to