r425 - /debtorrent/trunk/DebTorrent/BT1/HTTPDownloader.py

camrdale at users.alioth.debian.org camrdale at users.alioth.debian.org
Sun Mar 21 04:50:45 UTC 2010


Author: camrdale
Date: Sun Mar 21 04:50:44 2010
New Revision: 425

URL: http://svn.debian.org/wsvn/debtorrent/?sc=1&rev=425
Log:
Fix some stats problems with the tracking of seed and peer numbers

Modified:
    debtorrent/trunk/DebTorrent/BT1/HTTPDownloader.py

Modified: debtorrent/trunk/DebTorrent/BT1/HTTPDownloader.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/DebTorrent/BT1/HTTPDownloader.py?rev=425&op=diff
==============================================================================
--- debtorrent/trunk/DebTorrent/BT1/HTTPDownloader.py (original)
+++ debtorrent/trunk/DebTorrent/BT1/HTTPDownloader.py Sun Mar 21 04:50:44 2010
@@ -96,7 +96,6 @@
         self.downloader = downloader
         self.baseurl = url
         self.have = Bitfield(length = downloader.numpieces, defaultValue = True)
-        self.downloader.picker.got_seed()
         try:
             (scheme, self.netloc, path, params, query, fragment) = urlparse(url)
         except:
@@ -289,13 +288,12 @@
         if self.connection_status == 404:
             logger.warning('http seed is missing piece: ' + str(self.index))
             if self.have.complete():
-                self.downloader.picker.lost_seed()
                 self.have[self.index] = False
                 for i in xrange(len(self.have)):
                     if self.have[i]:
                         self.downloader.picker.got_have(i)
             else:
-                if self.have[i]:
+                if self.have[self.index]:
                     self.downloader.picker.lost_have(i)
                 self.have[self.index] = False
             return False




More information about the Debtorrent-commits mailing list