Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 00b4889

Browse files
committed
Replace ReadInt with ReadLong
1 parent 0dbc420 commit 00b4889

File tree

2 files changed

+4
-26
lines changed

2 files changed

+4
-26
lines changed

src/ServiceStack.Redis/Pipeline/RedisPipelineCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public List<long> ReadAllAsInts()
2424
var results = new List<long>();
2525
while (cmdCount-- > 0)
2626
{
27-
results.Add(client.ReadInt());
27+
results.Add(client.ReadLong());
2828
}
2929

3030
return results;

src/ServiceStack.Redis/RedisNativeClient_Utils.cs

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ public bool FlushSendBuffer()
415415
}
416416
}
417417
}
418+
418419
ResetSendBuffer();
419420
}
420421
catch (IOException ex) // several stream commands wrap SocketException in IOException
@@ -481,12 +482,12 @@ protected long SendExpectLong(params byte[][] cmdWithBinaryArgs)
481482

482483
if (Pipeline != null)
483484
{
484-
Pipeline.CompleteLongQueuedCommand(ReadInt);
485+
Pipeline.CompleteLongQueuedCommand(ReadLong);
485486
return default(long);
486487
}
487488
return ReadLong();
488489
}
489-
490+
490491
protected byte[] SendExpectData(params byte[][] cmdWithBinaryArgs)
491492
{
492493
if (!SendCommand(cmdWithBinaryArgs))
@@ -682,29 +683,6 @@ internal void ExpectQueued()
682683
ExpectWord(QUEUED);
683684
}
684685

685-
public long ReadInt()
686-
{
687-
int c = SafeReadByte();
688-
if (c == -1)
689-
throw CreateResponseError("No more data");
690-
691-
var s = ReadLine();
692-
693-
if (log.IsDebugEnabled)
694-
Log("R: {0}", s);
695-
696-
if (c == '-')
697-
throw CreateResponseError(s.StartsWith("ERR") ? s.Substring(4) : s);
698-
699-
if (c == ':' || c == '$')//really strange why ZRANK needs the '$' here
700-
{
701-
int i;
702-
if (int.TryParse(s, out i))
703-
return i;
704-
}
705-
throw CreateResponseError("Unknown reply on integer response: " + c + s);
706-
}
707-
708686
public long ReadLong()
709687
{
710688
int c = SafeReadByte();

0 commit comments

Comments
 (0)