Author: alanmc
Date: 2007-04-28 11:59:31 -0400 (Sat, 28 Apr 2007)
New Revision: 76431

Modified:
   trunk/bitsharp/src/MonoTorrent/Client/Managers/TorrentManager.cs
Log:
Enhancement: Removed excess logic as it is contained within AddNewPieceRequest

Modified: trunk/bitsharp/src/MonoTorrent/Client/Managers/TorrentManager.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/Client/Managers/TorrentManager.cs    
2007-04-28 13:41:17 UTC (rev 76430)
+++ trunk/bitsharp/src/MonoTorrent/Client/Managers/TorrentManager.cs    
2007-04-28 15:59:31 UTC (rev 76431)
@@ -511,13 +511,10 @@
                         if (id.Peer.Connection.PiecesSent > 50)
                             SetChokeStatus(id, true);
 
-                        while ((!id.Peer.Connection.IsChoking || 
id.Peer.Connection.IsAllowedFastPieces.Count > 0)
-                                && id.Peer.Connection.AmRequestingPiecesCount 
< PieceManager.MaxRequests && id.Peer.Connection.AmInterested)
-                        {
-                            // If there are no more pieces to add, 
AddPieceRequest will return null
-                            if (!this.pieceManager.AddPieceRequest(id))
-                                break;
-                        }
+                                               // If the peer is interesting, 
try to queue up some piece requests off him
+                                               
if(id.Peer.Connection.IsInterestingToMe)
+                                                       while 
(this.pieceManager.AddPieceRequest(id)) { }
+
                         if (nintySecondsAgo > 
id.Peer.Connection.LastMessageSent)
                         {
                             id.Peer.Connection.LastMessageSent = DateTime.Now;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to