77 references to VariableLengthIntegerHelper
InMemory.FunctionalTests (16)
Http3\Http3ConnectionTests.cs (1)
207await Http3Api.WaitForGoAwayAsync(false, VariableLengthIntegerHelper.EightByteLimit);
Http3\Http3StreamTests.cs (3)
3050var parameterLength = VariableLengthIntegerHelper.WriteInteger(outboundcontrolStream.Pair.Application.Output.GetSpan(), (long)Internal.Http3.Http3SettingType.MaxFieldSectionSize); 3261var idLength = VariableLengthIntegerHelper.WriteInteger(bufferPipe.Writer.GetSpan(), longToEncode: 1026); 3270idLength = VariableLengthIntegerHelper.WriteInteger(bufferPipe.Writer.GetSpan(), longToEncode: 100026);
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (12)
191if (!VariableLengthIntegerHelper.TryRead(payload.Span, out var streamId, out var _)) 848if (!VariableLengthIntegerHelper.TryGetInteger(payload, out var consumed, out var id)) 855if (!VariableLengthIntegerHelper.TryGetInteger(payload, out consumed, out var value)) 874var lengthWritten = VariableLengthIntegerHelper.WriteInteger(buffer, id); 885var data = new byte[VariableLengthIntegerHelper.GetByteCount(streamId)]; 886VariableLengthIntegerHelper.WriteInteger(data, streamId); 905length += VariableLengthIntegerHelper.GetByteCount((long)setting.Parameter); 906length += VariableLengthIntegerHelper.GetByteCount(setting.Value); 915var parameterLength = VariableLengthIntegerHelper.WriteInteger(destination, (long)setting.Parameter); 918var valueLength = VariableLengthIntegerHelper.WriteInteger(destination, (long)setting.Value); 936if (VariableLengthIntegerHelper.TryGetInteger(readableBuffer, out consumed, out var id)) 977if (!VariableLengthIntegerHelper.TryRead(payload.Span, out var streamId, out var _))
Microsoft.AspNetCore.Server.Kestrel.Core (24)
Internal\Http3\Http3Connection.cs (1)
706SendGoAwayAsync(VariableLengthIntegerHelper.EightByteLimit).Preserve();
Internal\Http3\Http3ControlStream.cs (4)
168if (VariableLengthIntegerHelper.TryGetInteger(readableBuffer, out consumed, out var id)) 384if (!VariableLengthIntegerHelper.TryGetInteger(payload, out consumed, out var id)) 389if (!VariableLengthIntegerHelper.TryGetInteger(payload.Slice(consumed), out consumed, out var value)) 490if (!VariableLengthIntegerHelper.TryGetInteger(payload, out consumed, out _))
Internal\Http3\Http3FrameReader.cs (2)
32if (!VariableLengthIntegerHelper.TryGetInteger(readableBuffer, out consumed, out var type)) 39if (!VariableLengthIntegerHelper.TryGetInteger(firstLengthBuffer, out consumed, out length))
Internal\Http3\Http3FrameWriter.cs (11)
106var buffer = _outputWriter.GetSpan(settingsLength + VariableLengthIntegerHelper.MaximumEncodedLength + 1); 116var settingsBytesWritten = VariableLengthIntegerHelper.WriteInteger(buffer, settingsLength); 135length += VariableLengthIntegerHelper.GetByteCount((long)setting.Parameter); 136length += VariableLengthIntegerHelper.GetByteCount(setting.Value); 145var parameterLength = VariableLengthIntegerHelper.WriteInteger(destination, (long)setting.Parameter); 148var valueLength = VariableLengthIntegerHelper.WriteInteger(destination, (long)setting.Value); 156_outputWriter.Advance(VariableLengthIntegerHelper.WriteInteger(buffer, id)); 241var length = VariableLengthIntegerHelper.GetByteCount(id); 248VariableLengthIntegerHelper.WriteInteger(buffer, id); 284var typeLength = VariableLengthIntegerHelper.WriteInteger(buffer, (int)frameType); 288var lengthLength = VariableLengthIntegerHelper.WriteInteger(buffer, (int)frameLength);
Internal\Http3\Http3PendingStream.cs (1)
63if (VariableLengthIntegerHelper.TryGetInteger(readableBuffer, out consumed, out var value))
src\Shared\runtime\Http3\Frames\Http3Frame.cs (5)
10public const int MaximumEncodedFrameEnvelopeLength = 1 + VariableLengthIntegerHelper.MaximumEncodedLength; // Frame type + payload length. 17if (VariableLengthIntegerHelper.TryRead(buffer, out a, out int aLength)) 20if (VariableLengthIntegerHelper.TryRead(buffer, out b, out int bLength)) 43Debug.Assert(VariableLengthIntegerHelper.GetByteCount((long)frameType) == 1, $"{nameof(TryWriteFrameEnvelope)} assumes {nameof(frameType)} will fit within a single byte varint."); 50if (VariableLengthIntegerHelper.TryWrite(buffer, payloadLength, out int payloadLengthEncodedLength))
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (25)
src\Shared\test\Shared.Tests\runtime\Http3\VariableLengthIntegerHelperTests.cs (23)
17bool isSuccess = VariableLengthIntegerHelper.TryRead(readOnlySpan, 32bool isSuccess = VariableLengthIntegerHelper.TryRead(readOnlySpan, 48bool isSuccess = VariableLengthIntegerHelper.TryRead(readOnlySpan, 63bool isSuccess = VariableLengthIntegerHelper.TryRead(readOnlySpan, 81bool isSuccess = VariableLengthIntegerHelper.TryRead(readOnlySpan, 96bool isSuccess = VariableLengthIntegerHelper.TryRead(readOnlySpan, 113bool isSuccess = VariableLengthIntegerHelper.TryRead(readOnlySpan, 128bool isSuccess = VariableLengthIntegerHelper.TryRead(readOnlySpan, 144bool isSuccess = VariableLengthIntegerHelper.TryRead(ref sequenceReader, 180bool isSuccess = VariableLengthIntegerHelper.TryRead(ref sequenceReader, 196bool isSuccess = VariableLengthIntegerHelper.TryRead(ref sequenceReader, 212bool isSuccess = VariableLengthIntegerHelper.TryRead(ref sequenceReader, 226bool result = VariableLengthIntegerHelper.TryGetInteger(readOnlySequence, 241bool result = VariableLengthIntegerHelper.TryGetInteger(readOnlySequence, 253bool isSuccess = VariableLengthIntegerHelper.TryWrite(span, 267bool isSuccess = VariableLengthIntegerHelper.TryWrite(span, 283bool isSuccess = VariableLengthIntegerHelper.TryWrite(span, 296bool isSuccess = VariableLengthIntegerHelper.TryWrite(span, 311bool isSuccess = VariableLengthIntegerHelper.TryWrite(span, 324bool isSuccess = VariableLengthIntegerHelper.TryWrite(span, 339bool isSuccess = VariableLengthIntegerHelper.TryWrite(span, 352bool isSuccess = VariableLengthIntegerHelper.TryWrite(span, 366int result = VariableLengthIntegerHelper.GetByteCount(longToEncode);
VariableIntHelperTests.cs (2)
17var result = VariableLengthIntegerHelper.TryGetInteger(new ReadOnlySequence<byte>(input), out _, out var decoded); 27var encodedLength = VariableLengthIntegerHelper.WriteInteger(outputBuffer, input);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (12)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (12)
191if (!VariableLengthIntegerHelper.TryRead(payload.Span, out var streamId, out var _)) 848if (!VariableLengthIntegerHelper.TryGetInteger(payload, out var consumed, out var id)) 855if (!VariableLengthIntegerHelper.TryGetInteger(payload, out consumed, out var value)) 874var lengthWritten = VariableLengthIntegerHelper.WriteInteger(buffer, id); 885var data = new byte[VariableLengthIntegerHelper.GetByteCount(streamId)]; 886VariableLengthIntegerHelper.WriteInteger(data, streamId); 905length += VariableLengthIntegerHelper.GetByteCount((long)setting.Parameter); 906length += VariableLengthIntegerHelper.GetByteCount(setting.Value); 915var parameterLength = VariableLengthIntegerHelper.WriteInteger(destination, (long)setting.Parameter); 918var valueLength = VariableLengthIntegerHelper.WriteInteger(destination, (long)setting.Value); 936if (VariableLengthIntegerHelper.TryGetInteger(readableBuffer, out consumed, out var id)) 977if (!VariableLengthIntegerHelper.TryRead(payload.Span, out var streamId, out var _))