|
@@ -125,11 +125,16 @@ namespace ISCSI.Server
|
|
|
|
|
|
internal static List<ISCSIPDU> GetSCSICommandResponse(SCSICommandPDU command, ISCSITarget target, SessionParameters session, ConnectionParameters connection)
|
|
|
{
|
|
|
- List<ISCSIPDU> responseList = new List<ISCSIPDU>();
|
|
|
string connectionIdentifier = StateObject.GetConnectionIdentifier(session, connection);
|
|
|
ISCSIServer.Log("[{0}] Executing Command: CmdSN: {1}", connectionIdentifier, command.CmdSN);
|
|
|
byte[] scsiResponse;
|
|
|
SCSIStatusCodeName status = target.ExecuteCommand(command.CommandDescriptorBlock, command.LUN, command.Data, out scsiResponse);
|
|
|
+ return PrepareSCSICommandResponse(command, status, scsiResponse, connection);
|
|
|
+ }
|
|
|
+
|
|
|
+ internal static List<ISCSIPDU> PrepareSCSICommandResponse(SCSICommandPDU command, SCSIStatusCodeName status, byte[] scsiResponse, ConnectionParameters connection)
|
|
|
+ {
|
|
|
+ List<ISCSIPDU> responseList = new List<ISCSIPDU>();
|
|
|
if (!command.Read || status != SCSIStatusCodeName.Good)
|
|
|
{
|
|
|
// RFC 3720: if the command is completed with an error, then the response and sense data MUST be sent in a SCSI Response PDU
|