Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ParseHeaderNameLength()

void System.Net.Http.HPack.HPackDecoder.ParseHeaderNameLength ( ReadOnlySpan< byte > data,
ref int currentIndex,
IHttpHeadersHandler handler )
inlineprivate

Definition at line 205 of file HPackDecoder.cs.

206 {
207 if (currentIndex >= data.Length)
208 {
209 return;
210 }
211 byte b = data[currentIndex++];
213 if (_integerDecoder.BeginTryDecode((byte)(b & 0xFFFFFF7Fu), 7, out var result))
214 {
215 if (result == 0)
216 {
217 throw new HPackDecodingException(System.SR.Format(System.SR.net_http_invalid_header_name, ""));
218 }
219 OnStringLength(result, State.HeaderName);
220 ParseHeaderName(data, ref currentIndex, handler);
221 }
222 else
223 {
224 _state = State.HeaderNameLengthContinue;
225 ParseHeaderNameLengthContinue(data, ref currentIndex, handler);
226 }
227 }
static bool IsHuffmanEncoded(byte b)
void OnStringLength(int length, State nextState)
void ParseHeaderNameLengthContinue(ReadOnlySpan< byte > data, ref int currentIndex, IHttpHeadersHandler handler)
void ParseHeaderName(ReadOnlySpan< byte > data, ref int currentIndex, IHttpHeadersHandler handler)
static string net_http_invalid_header_name
Definition SR.cs:180
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
Definition SR.cs:7
bool BeginTryDecode(byte b, int prefixLength, out int result)

References System.Net.Http.HPack.HPackDecoder._huffman, System.Net.Http.HPack.HPackDecoder._integerDecoder, System.Net.Http.HPack.HPackDecoder._state, System.Net.Http.HPack.IntegerDecoder.BeginTryDecode(), System.SR.Format(), System.Net.Http.HPack.HPackDecoder.IsHuffmanEncoded(), System.ReadOnlySpan< T >.Length, System.SR.net_http_invalid_header_name, System.Net.Http.HPack.HPackDecoder.OnStringLength(), System.Net.Http.HPack.HPackDecoder.ParseHeaderName(), and System.Net.Http.HPack.HPackDecoder.ParseHeaderNameLengthContinue().

Referenced by System.Net.Http.HPack.HPackDecoder.DecodeInternal(), and System.Net.Http.HPack.HPackDecoder.ParseLiteralHeaderField().