Author: alanmc
Date: 2006-12-03 12:11:14 -0500 (Sun, 03 Dec 2006)
New Revision: 68907

Modified:
   trunk/bitsharp/src/MonoTorrent.Client/PeerMessages/HaveMessage.cs
Log:
Reordering to make sure that piecePicker.IsInteresting(id) is definately called 
every time a Have message is received.

Modified: trunk/bitsharp/src/MonoTorrent.Client/PeerMessages/HaveMessage.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent.Client/PeerMessages/HaveMessage.cs   
2006-12-03 17:09:44 UTC (rev 68906)
+++ trunk/bitsharp/src/MonoTorrent.Client/PeerMessages/HaveMessage.cs   
2006-12-03 17:11:14 UTC (rev 68907)
@@ -111,8 +111,8 @@
         /// <param name="id">The Peer who's message will be handled</param>
         internal void Handle(PeerConnectionID id)
         {
-            if (id.Peer.Connection.BitField != null)
-                id.Peer.Connection.BitField[this.pieceIndex] = true;
+            id.Peer.Connection.BitField[this.pieceIndex] = true;
+            id.Peer.Connection.IsInterestingToMe = 
id.TorrentManager.PieceManager.IsInteresting(id);
 
             for (int i = 0; i < id.Peer.Connection.BitField.Array.Length - 1; 
i++)
                 if (id.Peer.Connection.BitField.Array[0] != ~0)
@@ -132,7 +132,6 @@
             }
 #warning This code is duplicated in the PieceMessage i think
             id.Peer.IsSeeder = true;
-            id.Peer.Connection.IsInterestingToMe = 
id.TorrentManager.PieceManager.IsInteresting(id);
         }
 
 

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

Reply via email to