Author: alanmc
Date: 2008-02-02 13:31:17 -0500 (Sat, 02 Feb 2008)
New Revision: 94642
Modified:
trunk/bitsharp/src/MonoTorrent/MonoTorrent.Client/Managers/ChangeLog
trunk/bitsharp/src/MonoTorrent/MonoTorrent.Client/Managers/ConnectionManager.cs
Log:
* MonoTorrent.Client/Managers/ConnectionManager.cs: Never try to
download more data than we are expecting - slight performance hit,
but fixes issue when integrating with other programs which expect
to be able to receive *exactly* the data i request.
Modified: trunk/bitsharp/src/MonoTorrent/MonoTorrent.Client/Managers/ChangeLog
===================================================================
--- trunk/bitsharp/src/MonoTorrent/MonoTorrent.Client/Managers/ChangeLog
2008-02-02 18:31:00 UTC (rev 94641)
+++ trunk/bitsharp/src/MonoTorrent/MonoTorrent.Client/Managers/ChangeLog
2008-02-02 18:31:17 UTC (rev 94642)
@@ -1,5 +1,12 @@
2008-02-02 Alan McGovern <[EMAIL PROTECTED]>
+ * ConnectionManager.cs: Never try to download more data than we are
+ expecting - slight performance hit, but fixes issue when integrating
+ with other programs which expect to be able to receive *exactly* the
+ data i request.
+
+2008-02-02 Alan McGovern <[EMAIL PROTECTED]>
+
* TorrentManager.cs: Cleaned up some of my method firing goodness
2008-02-02 Alan McGovern <[EMAIL PROTECTED]>
Modified:
trunk/bitsharp/src/MonoTorrent/MonoTorrent.Client/Managers/ConnectionManager.cs
===================================================================
---
trunk/bitsharp/src/MonoTorrent/MonoTorrent.Client/Managers/ConnectionManager.cs
2008-02-02 18:31:00 UTC (rev 94641)
+++
trunk/bitsharp/src/MonoTorrent/MonoTorrent.Client/Managers/ConnectionManager.cs
2008-02-02 18:31:17 UTC (rev 94642)
@@ -1136,7 +1136,7 @@
}
if (downloading)
{
- byteCount = id.Connection.recieveBuffer.Count -
id.Connection.BytesReceived > ChunkLength ? ChunkLength :
id.Connection.recieveBuffer.Count - id.Connection.BytesReceived;
+ byteCount = (id.Connection.BytesToRecieve -
id.Connection.BytesReceived) > ChunkLength ? ChunkLength :
id.Connection.BytesToRecieve - id.Connection.BytesReceived;
id.Connection.BeginReceive(id.Connection.recieveBuffer,
id.Connection.BytesReceived, byteCount, SocketFlags.None,
this.onEndReceiveMessageCallback, id, out id.ErrorCode);
}
else
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches