Commit 0231deb4 authored by Marc Gravell's avatar Marc Gravell

Merge branch 'deepakverma-master'

parents 04075c95 824567f4
...@@ -949,7 +949,16 @@ private RawResult ReadArray(byte[] buffer, ref int offset, ref int count) ...@@ -949,7 +949,16 @@ private RawResult ReadArray(byte[] buffer, ref int offset, ref int count)
if (!itemCount.TryGetInt64(out i64)) throw ExceptionFactory.ConnectionFailure(multiplexer.IncludeDetailInExceptions, ConnectionFailureType.ProtocolFailure, "Invalid array length", bridge.ServerEndPoint); if (!itemCount.TryGetInt64(out i64)) throw ExceptionFactory.ConnectionFailure(multiplexer.IncludeDetailInExceptions, ConnectionFailureType.ProtocolFailure, "Invalid array length", bridge.ServerEndPoint);
int itemCountActual = checked((int)i64); int itemCountActual = checked((int)i64);
if (itemCountActual <= 0) return RawResult.EmptyArray; if (itemCountActual < 0)
{
//for null response by command like EXEC, RESP array: *-1\r\n
return new RawResult(ResultType.SimpleString, null, 0, 0);
}
else if (itemCountActual == 0)
{
//for zero array response by command like SCAN, Resp array: *0\r\n
return RawResult.EmptyArray;
}
var arr = new RawResult[itemCountActual]; var arr = new RawResult[itemCountActual];
for (int i = 0; i < itemCountActual; i++) for (int i = 0; i < itemCountActual; i++)
......
...@@ -417,6 +417,19 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes ...@@ -417,6 +417,19 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
SetResult(message, false); SetResult(message, false);
return true; return true;
} }
//EXEC returned with a NULL
if (!tran.IsAborted && result.IsNull)
{
connection.Multiplexer.Trace("Server aborted due to failed EXEC");
//cancel the commands in the transaction and mark them as complete with the completion manager
foreach (var op in wrapped)
{
op.Wrapped.Cancel();
bridge.CompleteSyncOrAsync(op.Wrapped);
}
SetResult(message, false);
return true;
}
break; break;
case ResultType.MultiBulk: case ResultType.MultiBulk:
if (!tran.IsAborted) if (!tran.IsAborted)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment