fix: Fixes reading incoming string packets (#1819)
This commit is contained in:
parent
04a15e9620
commit
db6e852c91
1 changed files with 5 additions and 1 deletions
|
|
@ -195,7 +195,11 @@ public ref struct SpanReader
|
||||||
|
|
||||||
var span = _buffer.Slice(Position, size);
|
var span = _buffer.Slice(Position, size);
|
||||||
var index = span.IndexOfTerminator(byteLength);
|
var index = span.IndexOfTerminator(byteLength);
|
||||||
span = _buffer.Slice(Position, index);
|
|
||||||
|
if (index > -1)
|
||||||
|
{
|
||||||
|
span = _buffer.Slice(Position, index);
|
||||||
|
}
|
||||||
|
|
||||||
Position += isFixedLength || index < 0 ? size : index + 1;
|
Position += isFixedLength || index < 0 ? size : index + 1;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue