Author: alanmc
Date: 2008-02-02 11:25:14 -0500 (Sat, 02 Feb 2008)
New Revision: 94636

Modified:
   trunk/bitsharp/src/MonoTorrent/MonoTorrent.Client/Managers/BufferManager.cs
Log:
Reenabled the buffer manager

Modified: 
trunk/bitsharp/src/MonoTorrent/MonoTorrent.Client/Managers/BufferManager.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/MonoTorrent.Client/Managers/BufferManager.cs 
2008-02-02 16:24:57 UTC (rev 94635)
+++ trunk/bitsharp/src/MonoTorrent/MonoTorrent.Client/Managers/BufferManager.cs 
2008-02-02 16:25:14 UTC (rev 94636)
@@ -108,8 +108,6 @@
         /// <param name="type">The type of buffer that is needed</param>
         private void GetBuffer(ref ArraySegment<byte> buffer, BufferType type)
         {
-            buffer = new ArraySegment<byte>(new byte[LargeMessageBufferSize], 
0, LargeMessageBufferSize);
-            return;
             // We check to see if the buffer already there is the empty 
buffer. If it isn't, then we have
             // a buffer leak somewhere and the buffers aren't being freed 
properly.
             if (buffer != EmptyBuffer)
@@ -155,8 +153,6 @@
         /// <param name="type">The type of buffer that is needed</param>
         public void GetBuffer(ref ArraySegment<byte> buffer, int minCapacity)
         {
-            buffer = new ArraySegment<byte>(new byte[minCapacity], 0, 
minCapacity);
-            return;
             if (buffer != EmptyBuffer)
                 throw new TorrentException("The old Buffer should have been 
recovered before getting a new buffer");
 
@@ -193,8 +189,6 @@
         /// <returns></returns>
         public void FreeBuffer(ref ArraySegment<byte> buffer)
         {
-            return;
-            // If true, the buffer has already been freed, so we just return
             if (buffer == EmptyBuffer)
                 return;
 
@@ -225,7 +219,6 @@
 
         private void AllocateBuffers(int number, BufferType type)
         {
-            return;
             Logger.Log(null, "BufferManager - Allocating {0} buffers of type 
{1}", number, type);
             if (type == BufferType.LargeMessageBuffer)
                 while (number > 0)

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

Reply via email to