10 private static readonly
byte[]
s_http3Utf8 =
new byte[2] { 104, 51 };
12 private static readonly
byte[]
s_http2Utf8 =
new byte[2] { 104, 50 };
14 private static readonly
byte[]
s_http11Utf8 =
new byte[8] { 104, 116, 116, 112, 47, 49, 46, 49 };
28 if (protocol.Length == 0 || protocol.Length > 255)
50 public override bool Equals([NotNullWhen(
true)]
object?
obj)
62 if (readOnlyProtocol ==
null)
67 for (
int i = 0; i < readOnlyProtocol.Length; i++)
69 num = ((num << 5) + num) ^ readOnlyProtocol[i];
79 return (readOnlyProtocol ==
null) ? string.Empty : ((readOnlyProtocol ==
s_http3Utf8) ?
"h3" : ((readOnlyProtocol ==
s_http2Utf8) ?
"h2" : ((readOnlyProtocol ==
s_http11Utf8) ?
"http/1.1" :
s_utf8.GetString(readOnlyProtocol))));
83 char[]
array =
new char[readOnlyProtocol.Length * 5];
85 for (
int i = 0; i <
array.Length; i += 5)
87 byte b = readOnlyProtocol[num++];
100 return left.
Equals(right);
105 return !(left == right);
static char ToCharLower(int value)
static string net_ssl_app_protocol_invalid
static DecoderFallback ExceptionFallback
static EncoderFallback ExceptionFallback
static Encoding GetEncoding(int codepage)
ReadOnlyMemory< byte > Protocol
override string ToString()
static readonly SslApplicationProtocol Http2
override bool Equals([NotNullWhen(true)] object? obj)
static readonly byte[] s_http3Utf8
static readonly byte[] s_http2Utf8
static bool operator!=(SslApplicationProtocol left, SslApplicationProtocol right)
static readonly Encoding s_utf8
static readonly SslApplicationProtocol Http3
bool Equals(SslApplicationProtocol other)
SslApplicationProtocol(string protocol)
static bool operator==(SslApplicationProtocol left, SslApplicationProtocol right)
static readonly byte[] s_http11Utf8
SslApplicationProtocol(byte[] protocol, bool copy)
static readonly SslApplicationProtocol Http11
SslApplicationProtocol(byte[] protocol)
readonly byte[] _readOnlyProtocol
override int GetHashCode()