r419 - in /debtorrent/trunk: DebTorrent/BT1/HTTPDownloader.py debian/changelog

camrdale at users.alioth.debian.org camrdale at users.alioth.debian.org
Sat Mar 20 21:53:16 UTC 2010


Author: camrdale
Date: Sat Mar 20 21:53:15 2010
New Revision: 419

URL: http://svn.debian.org/wsvn/debtorrent/?sc=1&rev=419
Log:
Fix endless rerequesting pieces HTTP seed doesn't have (Closes: #516708)

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

Modified: debtorrent/trunk/DebTorrent/BT1/HTTPDownloader.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/DebTorrent/BT1/HTTPDownloader.py?rev=419&op=diff
==============================================================================
--- debtorrent/trunk/DebTorrent/BT1/HTTPDownloader.py (original)
+++ debtorrent/trunk/DebTorrent/BT1/HTTPDownloader.py Sat Mar 20 21:53:15 2010
@@ -95,6 +95,7 @@
         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:
@@ -284,6 +285,19 @@
         
         """
         
+        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]:
+                    self.downloader.picker.lost_have(i)
+                self.have[self.index] = False
+            return False
         if self.connection_status not in [200, 206]:
             logger.warning('bad status from http seed: '+str(self.connection_status))
             self.errorcount += 1

Modified: debtorrent/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/debian/changelog?rev=419&op=diff
==============================================================================
--- debtorrent/trunk/debian/changelog (original)
+++ debtorrent/trunk/debian/changelog Sat Mar 20 21:53:15 2010
@@ -1,14 +1,15 @@
 debtorrent (0.1.10) unstable; urgency=low
 
+  * Fix endless rerequesting pieces HTTP seed doesn't have (Closes: #516708)
+  * Fix piuparts uninstallation failure (Closes: #574198)
   * Prevent symlink attack when upgrading from pre 0.1.6 (Closes: #500180)
   * Add a status verb to init.d scripts (Closes: #498606)
   * Fix exception when server doesn't return modified time (Closes: #515753)
-  * Fix piuparts uninstallation failure (Closes: #574198)
   * Add a graphical display of the pieces all peers have, thanks 
     Steve Cotton (Closes: #515771)
   * Fix bug in info page display when seeding (Closes: #524056)
 
- -- Cameron Dale <camrdale at gmail.com>  Sat, 20 Mar 2010 13:21:00 -0700
+ -- Cameron Dale <camrdale at gmail.com>  Sat, 20 Mar 2010 14:51:32 -0700
 
 debtorrent (0.1.9) unstable; urgency=low
 




More information about the Debtorrent-commits mailing list