Jelajahi Sumber

iSCSI Console v1.3.1

Tal Aloni 8 tahun lalu
induk
melakukan
0aef48e73d
3 mengubah file dengan 26 tambahan dan 20 penghapusan
  1. 10 7
      ISCSI/Client/ISCSIClient.cs
  2. 2 2
      ISCSI/Properties/AssemblyInfo.cs
  3. 14 11
      ISCSI/RevisionHistory.txt

+ 10 - 7
ISCSI/Client/ISCSIClient.cs

@@ -6,6 +6,7 @@
  */
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.IO;
 using System.Net;
 using System.Net.Sockets;
@@ -38,10 +39,11 @@ namespace ISCSI.Client
         private int m_targetPort;
         private bool m_isConnected;
         private Socket m_clientSocket;
+        private IAsyncResult m_currentAsyncResult;
         
         private object m_incomingQueueLock = new object();
         private List<ISCSIPDU> m_incomingQueue = new List<ISCSIPDU>();
-        private IAsyncResult m_currentAsyncResult;
+        private EventWaitHandle m_incomingQueueEventHandle = new EventWaitHandle(false, EventResetMode.AutoReset);
 
         public static object m_logSyncLock = new object();
         private static FileStream m_logFile = null;
@@ -206,7 +208,7 @@ namespace ISCSI.Client
                 if (capacity.ReturnedLBA != 0xFFFFFFFF)
                 {
                     bytesPerSector = (int)capacity.BlockLengthInBytes;
-                    return (capacity.ReturnedLBA + 1) * capacity.BlockLengthInBytes;
+                    return (ulong)(capacity.ReturnedLBA + 1) * capacity.BlockLengthInBytes;
                 }
 
                 readCapacity = ClientHelper.GetReadCapacity16Command(m_session, m_connection, LUN);
@@ -216,7 +218,7 @@ namespace ISCSI.Client
                 {
                     ReadCapacity16Parameter capacity16 = new ReadCapacity16Parameter(data.Data);
                     bytesPerSector = (int)capacity16.BlockLengthInBytes;
-                    return (capacity16.ReturnedLBA + 1) * capacity16.BlockLengthInBytes;
+                    return (ulong)(capacity16.ReturnedLBA + 1) * capacity16.BlockLengthInBytes;
                 }
             }
 
@@ -452,14 +454,16 @@ namespace ISCSI.Client
             lock (m_incomingQueueLock)
             {
                 m_incomingQueue.Add(pdu);
+                m_incomingQueueEventHandle.Set();
             }
         }
 
         public ISCSIPDU WaitForPDU(uint initiatorTaskTag)
         {
             const int TimeOut = 5000;
-            int timespan = 0;
-            while (timespan < TimeOut)
+            Stopwatch stopwatch = new Stopwatch();
+            stopwatch.Start();
+            while (stopwatch.ElapsedMilliseconds < TimeOut)
             {
                 lock (m_incomingQueueLock)
                 {
@@ -473,8 +477,7 @@ namespace ISCSI.Client
                         }
                     }
                 }
-                Thread.Sleep(100);
-                timespan += 100;
+                m_incomingQueueEventHandle.WaitOne(100);
             }
             return null;
         }

+ 2 - 2
ISCSI/Properties/AssemblyInfo.cs

@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
 //
 // You can specify all the values or you can default the Revision and Build Numbers 
 // by using the '*' as shown below:
-[assembly: AssemblyVersion("1.3.0.0")]
-[assembly: AssemblyFileVersion("1.3.0.0")]
+[assembly: AssemblyVersion("1.3.1.0")]
+[assembly: AssemblyFileVersion("1.3.1.0")]

+ 14 - 11
ISCSI/RevisionHistory.txt

@@ -3,19 +3,19 @@ Revision History:
 1.0.0 - Initial release.
 
 1.0.1 - Support for multiple connections to the iSCSI server (one connection per session).
-		Disabled unnecessary disk read operations when logging is turned off.
+        Disabled unnecessary disk read operations when logging is turned off.
 		
 1.0.2 - Write operation to disk is now performed only when the complete SCSI command data has been received.
-		Support for iSCSI command queue.
+        Support for iSCSI command queue.
 		
 1.0.6 - Fixed protocol related bugs.
-		Properly handle implicit logout.
-		Improved logging.
+        Properly handle implicit logout.
+        Improved logging.
 
 1.0.7 - Added support for the 'Request Sense' command.
 
 1.0.8 - Nagle's algorithm has been disabled.
-		Unsupported SCSI CDBs are now properly rejected.
+        Unsupported SCSI CDBs are now properly rejected.
 
 1.0.9 - Minor bugfix.
 
@@ -28,7 +28,7 @@ Revision History:
 1.1.3 - Bugfix: CRC error was reported on all I/O errors.
 
 1.1.4 - Increased receive buffer size to 128KB.
-		Added timestamp to log.
+        Added timestamp to log.
 
 1.1.5 - The log file is now written directly to disk, without passing through the file system cache.
 
@@ -38,18 +38,18 @@ Revision History:
 		Added support for the Control mode page (0x0A) PageCode for the ModeSense6 SCSI command.
 
 1.1.9 - Added support for the Read6, Write6 SCSI commands.
-		Added support for the Block Limits (0xB0), Block Device Characteristics (0xB1) VPD pages.
-		Unsupported SCSI commands are now properly reported to the initiator.
+        Added support for the Block Limits (0xB0), Block Device Characteristics (0xB1) VPD pages.
+        Unsupported SCSI commands are now properly reported to the initiator.
 
 1.2.0 - Minor improvements.
 
 1.2.1 - Minor improvements.
 
 1.2.2 - Protocol related bugfixes and improvements.
-		Added iSCSI Client implementation.
+        Added iSCSI Client implementation.
 
 1.2.3 - Bugfix: login requests starting from stage 1 are now properly handled.
-		Bugfix: Unsupported SCSI commands are now properly handled.
+        Bugfix: Unsupported SCSI commands are now properly handled.
 
 1.2.4 - Improved separation between the iSCSI and SCSI layers.
 
@@ -64,4 +64,7 @@ Revision History:
 1.2.9 - Reject improper commands before login is complete.
 
 1.3.0 - Bugfix: Invalid ReadCapacity16 command response was returend.
-		Bugfix: Incorrect ResidualCount value was returned.
+        Bugfix: Incorrect ResidualCount value was returned.
+
+1.3.1 - Bugfix: iSCSI Client did not report the correct capacity when >4GB.
+        Improved iSCSI Client performance.