fix: Check for 13/10 EOL in heartbeat frame
This commit is contained in:
parent
8b7d743dad
commit
6884d5715f
@ -86,14 +86,21 @@ namespace ArStomp
|
|||||||
var inputstream = new MemoryStream(msgBuffer);
|
var inputstream = new MemoryStream(msgBuffer);
|
||||||
var bodyoutput = new MemoryStream();
|
var bodyoutput = new MemoryStream();
|
||||||
|
|
||||||
if (inputstream.ReadByte() == 10)
|
var firstByte = inputstream.ReadByte();
|
||||||
|
if (firstByte == 10)
|
||||||
{
|
{
|
||||||
return HeartbeatFrame;
|
return HeartbeatFrame;
|
||||||
}
|
}
|
||||||
else
|
else if (firstByte == 13) {
|
||||||
{
|
var secondByte = inputstream.ReadByte();
|
||||||
inputstream.Seek(0, SeekOrigin.Begin);
|
if (secondByte == 10) {
|
||||||
|
return HeartbeatFrame;
|
||||||
|
} else {
|
||||||
|
throw new Exception("Invalid frame");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// start from beginning
|
||||||
|
inputstream.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
StreamReader reader = findBody(inputstream);
|
StreamReader reader = findBody(inputstream);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user