fix: Fixes reading incoming string packets (#1819)

This commit is contained in:
Kamron Batman 2024-06-03 14:49:26 -07:00 committed by GitHub
parent 04a15e9620
commit db6e852c91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -195,7 +195,11 @@ public ref struct SpanReader
var span = _buffer.Slice(Position, size);
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;