5 writes to _lineLength
Microsoft.Extensions.AI.OpenAI (5)
src\Shared\ServerSentEvents\SseParser_1.cs (5)
154
_lineLength
-= advance;
234
_lineLength
-= advance;
504
_lineLength
+= bytesRead;
531
_lineLength
+= bytesRead;
553
_lineLength
-= 3;
23 references to _lineLength
Microsoft.Extensions.AI.OpenAI (23)
src\Shared\ServerSentEvents\SseParser_1.cs (23)
125
while (FillLineBuffer() != 0 &&
_lineLength
< Utf8Bom.Length);
143
_newlineIndex - _lineOffset + 1 <
_lineLength
|| // we must have CR and we have whatever comes after it
163
_lastSearchedForNewline = _lineOffset +
_lineLength
;
205
while (await FillLineBufferAsync(cancellationToken).ConfigureAwait(false) != 0 &&
_lineLength
< Utf8Bom.Length) ;
223
_newlineIndex - _lineOffset + 1 <
_lineLength
|| // newline is CR, and we have whatever comes after it
274
searchLength =
_lineLength
- (_lastSearchedForNewline - _lineOffset);
279
searchLength =
_lineLength
;
282
Debug.Assert(searchOffset >= _lineOffset, $"{searchOffset}, {
_lineLength
}");
283
Debug.Assert(searchOffset <= _lineOffset +
_lineLength
, $"{searchOffset}, {_lineOffset}, {
_lineLength
}");
287
Debug.Assert(searchLength <=
_lineLength
, $"{searchLength}, {
_lineLength
}");
292
Debug.Assert(_newlineIndex - _lineOffset <
_lineLength
, "Expected to be positioned at a non-empty newline");
293
return _lineBuffer.AsSpan(_newlineIndex,
_lineLength
- (_newlineIndex - _lineOffset)).StartsWith(CRLF) ? 2 : 1;
309
if (_lineOffset +
_lineLength
== _lineBuffer.Length)
313
_lineBuffer.AsSpan(_lineOffset,
_lineLength
).CopyTo(_lineBuffer);
321
else if (
_lineLength
== _lineBuffer.Length)
392
ReadOnlySpan<byte> remainder = _lineBuffer.AsSpan(_newlineIndex + newlineLength,
_lineLength
- line.Length - newlineLength);
407
if (_dataBuffer is null || _dataLength +
_lineLength
+ 1 > _dataBuffer.Length)
409
GrowBuffer(ref _dataBuffer, _dataLength +
_lineLength
+ 1);
494
int offset = _lineOffset +
_lineLength
;
520
int offset = _lineOffset +
_lineLength
;
550
if (_lineBuffer.AsSpan(0,
_lineLength
).StartsWith(Utf8Bom))