r389 - in /debtorrent/trunk: DebTorrent/ServerPortHandler.py DebTorrent/launchmanycore.py debian/changelog

camrdale-guest at users.alioth.debian.org camrdale-guest at users.alioth.debian.org
Sun Jun 22 19:23:07 UTC 2008


Author: camrdale-guest
Date: Sun Jun 22 19:23:06 2008
New Revision: 389

URL: http://svn.debian.org/wsvn/debtorrent/?sc=1&rev=389
Log:
Fix: stopping long-lived torrents will not prevent new torrents from
stalling at 'waiting for hash check' (Closes: #463676)

Modified:
    debtorrent/trunk/DebTorrent/ServerPortHandler.py
    debtorrent/trunk/DebTorrent/launchmanycore.py
    debtorrent/trunk/debian/changelog

Modified: debtorrent/trunk/DebTorrent/ServerPortHandler.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/DebTorrent/ServerPortHandler.py?rev=389&op=diff
==============================================================================
--- debtorrent/trunk/DebTorrent/ServerPortHandler.py (original)
+++ debtorrent/trunk/DebTorrent/ServerPortHandler.py Sun Jun 22 19:23:06 2008
@@ -33,6 +33,8 @@
     
     @type info_hash: C{string}
     @ivar info_hash: the torrent infohash this Server is responsible for
+    @type identifier: C{string}
+    @ivar identifier: the identifier of the torrent
     @type doneflag: C{threading.Event}
     @ivar doneflag: flag to indicate this torrent is being shutdown
     @type protocol: C{string}
@@ -52,11 +54,13 @@
     
     """
     
-    def __init__(self, info_hash, multihandler, doneflag, protocol):
+    def __init__(self, info_hash, identifier, multihandler, doneflag, protocol):
         """Initialize the instance.
         
         @type info_hash: C{string}
         @param info_hash: the torrent infohash this Server is responsible for
+        @type identifier: C{string}
+        @param identifier: the identifier of the torrent
         @type multihandler: L{MultiHandler}
         @param multihandler: the collection of all individual simplified servers
         @type doneflag: C{threading.Event}
@@ -67,6 +71,7 @@
         """
         
         self.info_hash = info_hash
+        self.identifier = identifier
         self.doneflag = doneflag
         self.protocol = protocol
         self.multihandler = multihandler
@@ -79,7 +84,7 @@
     def shutdown(self):
         """Tell the collection to shutdown this torrent."""
         if not self.finished:
-            self.multihandler.shutdown_torrent(self.info_hash)
+            self.multihandler.shutdown_torrent(self.identifier)
 
     def _shutdown(self):
         """Shutdown this torrent."""
@@ -554,11 +559,13 @@
         self.connections = {}
         self.taskqueues = {}
 
-    def newRawServer(self, info_hash, doneflag, protocol=protocol_name):
+    def newRawServer(self, info_hash, identifier, doneflag, protocol=protocol_name):
         """Create a new Server for the torrent.
         
         @type info_hash: C{string}
         @param info_hash: the torrent's infohash
+        @type identifier: C{string}
+        @param identifier: the identifier of the torrent
         @type doneflag: C{threading.Event}
         @param doneflag: the flag to indicate stopping to the new Server
         @type protocol: C{string}
@@ -569,20 +576,20 @@
         
         """
         
-        new = SingleRawServer(info_hash, self, doneflag, protocol)
-        self.singlerawservers[info_hash] = new
+        new = SingleRawServer(info_hash, identifier, self, doneflag, protocol)
+        self.singlerawservers[identifier] = new
         return new
 
-    def shutdown_torrent(self, info_hash):
+    def shutdown_torrent(self, identifier):
         """Shutdown a single torrent's Server.
         
-        @type info_hash: C{string}
-        @param info_hash: the torrent's infohash
-
-        """
-        
-        self.singlerawservers[info_hash]._shutdown()
-        del self.singlerawservers[info_hash]
+        @type identifier: C{string}
+        @param identifier: the identifier of the torrent
+
+        """
+        
+        self.singlerawservers[identifier]._shutdown()
+        del self.singlerawservers[identifier]
 
     def listen_forever(self):
         """Call the master server's listen loop.

Modified: debtorrent/trunk/DebTorrent/launchmanycore.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/DebTorrent/launchmanycore.py?rev=389&op=diff
==============================================================================
--- debtorrent/trunk/DebTorrent/launchmanycore.py (original)
+++ debtorrent/trunk/DebTorrent/launchmanycore.py Sun Jun 22 19:23:06 2008
@@ -141,7 +141,7 @@
         self.status_errtime = 0
         self.status_done = 0.0
 
-        self.rawserver = controller.handler.newRawServer(identifier, self.doneflag)
+        self.rawserver = controller.handler.newRawServer(hash, identifier, self.doneflag)
 
         d = BT1Download(self.update_status, self.finished, self.error,
                         self.doneflag, config, response, identifier,

Modified: debtorrent/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/debian/changelog?rev=389&op=diff
==============================================================================
--- debtorrent/trunk/debian/changelog (original)
+++ debtorrent/trunk/debian/changelog Sun Jun 22 19:23:06 2008
@@ -1,3 +1,10 @@
+debtorrent (0.1.8) unstable; urgency=low
+
+  * Fix: stopping long-lived torrents will not prevent new torrents from
+    stalling at 'waiting for hash check' (Closes: #463676)
+
+ -- Cameron Dale <camrdale at gmail.com>  Sun, 22 Jun 2008 12:16:14 -0700
+
 debtorrent (0.1.7) unstable; urgency=low
 
   * Display the torrent identifier on the local status page




More information about the Debtorrent-commits mailing list