Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
KnownHeader.cs
Go to the documentation of this file.
1
using
System.Diagnostics.CodeAnalysis
;
2
using
System.Net.Http.HPack
;
3
using
System.Net.Http.QPack
;
4
using
System.Text
;
5
6
namespace
System.Net.Http.Headers
;
7
8
internal
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
20
public
HeaderDescriptor
Descriptor
=>
new
HeaderDescriptor
(
this
);
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;
42
AsciiBytesWithColonSpace
=
array
;
43
}
44
45
[MemberNotNull(
"Http2EncodedName"
)]
46
[MemberNotNull(
"Http3EncodedName"
)]
47
private
void
Initialize
(
int
? http2StaticTableIndex,
int
? http3StaticTableIndex)
48
{
49
Http2EncodedName
= (http2StaticTableIndex.HasValue ?
HPackEncoder
.
EncodeLiteralHeaderFieldWithoutIndexingToAllocatedArray
(http2StaticTableIndex.GetValueOrDefault()) :
HPackEncoder
.
EncodeLiteralHeaderFieldWithoutIndexingNewNameToAllocatedArray
(
Name
));
50
Http3EncodedName
= (http3StaticTableIndex.HasValue ?
QPackEncoder
.
EncodeLiteralHeaderFieldWithStaticNameReferenceToArray
(http3StaticTableIndex.GetValueOrDefault()) :
QPackEncoder
.
EncodeLiteralHeaderFieldWithoutNameReferenceToArray
(
Name
));
51
}
52
}
System.Net.Http.HPack.HPackEncoder.EncodeLiteralHeaderFieldWithoutIndexingToAllocatedArray
static byte[] EncodeLiteralHeaderFieldWithoutIndexingToAllocatedArray(int index)
Definition
HPackEncoder.cs:220
System.Net.Http.HPack.HPackEncoder.EncodeLiteralHeaderFieldWithoutIndexingNewNameToAllocatedArray
static byte[] EncodeLiteralHeaderFieldWithoutIndexingNewNameToAllocatedArray(string name)
Definition
HPackEncoder.cs:228
System.Net.Http.HPack.HPackEncoder
Definition
HPackEncoder.cs:6
System.Net.Http.Headers.HttpHeaderParser
Definition
HttpHeaderParser.cs:8
System.Net.Http.Headers.KnownHeader.KnownValues
string[] KnownValues
Definition
KnownHeader.cs:16
System.Net.Http.Headers.KnownHeader.KnownHeader
KnownHeader(string name, int? http2StaticTableIndex=null, int? http3StaticTableIndex=null)
Definition
KnownHeader.cs:26
System.Net.Http.Headers.KnownHeader.HeaderType
HttpHeaderType HeaderType
Definition
KnownHeader.cs:14
System.Net.Http.Headers.KnownHeader.Http3EncodedName
byte[] Http3EncodedName
Definition
KnownHeader.cs:24
System.Net.Http.Headers.KnownHeader.Parser
HttpHeaderParser Parser
Definition
KnownHeader.cs:12
System.Net.Http.Headers.KnownHeader.Descriptor
HeaderDescriptor Descriptor
Definition
KnownHeader.cs:20
System.Net.Http.Headers.KnownHeader.Name
string Name
Definition
KnownHeader.cs:10
System.Net.Http.Headers.KnownHeader.KnownHeader
KnownHeader(string name, HttpHeaderType headerType, HttpHeaderParser parser, string[] knownValues=null, int? http2StaticTableIndex=null, int? http3StaticTableIndex=null)
Definition
KnownHeader.cs:31
System.Net.Http.Headers.KnownHeader.Initialize
void Initialize(int? http2StaticTableIndex, int? http3StaticTableIndex)
Definition
KnownHeader.cs:47
System.Net.Http.Headers.KnownHeader.Http2EncodedName
byte[] Http2EncodedName
Definition
KnownHeader.cs:22
System.Net.Http.Headers.KnownHeader.AsciiBytesWithColonSpace
byte[] AsciiBytesWithColonSpace
Definition
KnownHeader.cs:18
System.Net.Http.Headers.KnownHeader
Definition
KnownHeader.cs:9
System.Net.Http.QPack.QPackEncoder.EncodeLiteralHeaderFieldWithoutNameReferenceToArray
static byte[] EncodeLiteralHeaderFieldWithoutNameReferenceToArray(string name)
Definition
QPackEncoder.cs:96
System.Net.Http.QPack.QPackEncoder.EncodeLiteralHeaderFieldWithStaticNameReferenceToArray
static byte[] EncodeLiteralHeaderFieldWithStaticNameReferenceToArray(int index)
Definition
QPackEncoder.cs:51
System.Net.Http.QPack.QPackEncoder
Definition
QPackEncoder.cs:7
System.Text.Encoding.ASCII
static Encoding ASCII
Definition
Encoding.cs:511
System.Text.Encoding
Definition
Encoding.cs:15
System.Diagnostics.CodeAnalysis
Definition
AllowNullAttribute.cs:1
System.Net.Http.HPack
Definition
DynamicTable.cs:1
System.Net.Http.Headers.HttpHeaderType
HttpHeaderType
Definition
HttpHeaderType.cs:5
System.Net.Http.Headers.HttpHeaderType.Custom
@ Custom
System.Net.Http.Headers
Definition
AltSvcHeaderParser.cs:4
System.Net.Http.QPack
Definition
QPackDecoder.cs:5
System.Text
Definition
ConsoleEncoding.cs:1
System.ExceptionArgument.bytes
@ bytes
System.ExceptionArgument.array
@ array
System.Net.Http.Headers.HeaderDescriptor
Definition
HeaderDescriptor.cs:9
source
System.Net.Http
System.Net.Http.Headers
KnownHeader.cs
Generated by
1.10.0