Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
KnownHeader.cs
Go to the documentation of this file.
4using System.Text;
5
7
8internal sealed class KnownHeader
9{
10 public string Name { get; }
11
12 public HttpHeaderParser Parser { get; }
13
14 public HttpHeaderType HeaderType { get; }
15
16 public string[] KnownValues { get; }
17
18 public byte[] AsciiBytesWithColonSpace { get; }
19
21
22 public byte[] Http2EncodedName { get; private set; }
23
24 public byte[] Http3EncodedName { get; private set; }
25
26 public KnownHeader(string name, int? http2StaticTableIndex = null, int? http3StaticTableIndex = null)
27 : this(name, HttpHeaderType.Custom, null, null, http2StaticTableIndex, http3StaticTableIndex)
28 {
29 }
30
31 public KnownHeader(string name, HttpHeaderType headerType, HttpHeaderParser parser, string[] knownValues = null, int? http2StaticTableIndex = null, int? http3StaticTableIndex = null)
32 {
33 Name = name;
34 HeaderType = headerType;
35 Parser = parser;
36 KnownValues = knownValues;
37 Initialize(http2StaticTableIndex, http3StaticTableIndex);
38 byte[] array = new byte[name.Length + 2];
39 int bytes = Encoding.ASCII.GetBytes(name, array);
40 array[^2] = 58;
41 array[^1] = 32;
43 }
44
45 [MemberNotNull("Http2EncodedName")]
46 [MemberNotNull("Http3EncodedName")]
47 private void Initialize(int? http2StaticTableIndex, int? http3StaticTableIndex)
48 {
51 }
52}
static byte[] EncodeLiteralHeaderFieldWithoutIndexingToAllocatedArray(int index)
static byte[] EncodeLiteralHeaderFieldWithoutIndexingNewNameToAllocatedArray(string name)
KnownHeader(string name, int? http2StaticTableIndex=null, int? http3StaticTableIndex=null)
KnownHeader(string name, HttpHeaderType headerType, HttpHeaderParser parser, string[] knownValues=null, int? http2StaticTableIndex=null, int? http3StaticTableIndex=null)
void Initialize(int? http2StaticTableIndex, int? http3StaticTableIndex)
static byte[] EncodeLiteralHeaderFieldWithoutNameReferenceToArray(string name)
static byte[] EncodeLiteralHeaderFieldWithStaticNameReferenceToArray(int index)
static Encoding ASCII
Definition Encoding.cs:511