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

◆ TryReadQuotedAltAuthority()

static bool System.Net.Http.Headers.AltSvcHeaderParser.TryReadQuotedAltAuthority ( string value,
int startIndex,
out string host,
out int port,
out int readLength )
inlinestaticprivate

Definition at line 246 of file AltSvcHeaderParser.cs.

247 {
248 if (HttpRuleParser.GetQuotedStringLength(value, startIndex, out var length) == HttpParseResult.Parsed)
249 {
250 ReadOnlySpan<char> span = value.AsSpan(startIndex + 1, length - 2);
251 int num = span.IndexOf(':');
252 if (num != -1 && TryReadQuotedInt32Value(span.Slice(num + 1), out port))
253 {
254 if (num == 0)
255 {
256 host = null;
257 }
258 else if (!TryReadQuotedValue(span.Slice(0, num), out host))
259 {
260 goto IL_0056;
261 }
262 readLength = length;
263 return true;
264 }
265 }
266 goto IL_0056;
267 IL_0056:
268 host = null;
269 port = 0;
270 readLength = 0;
271 return false;
272 }
static bool TryReadQuotedValue(ReadOnlySpan< char > value, out string result)
static bool TryReadQuotedInt32Value(ReadOnlySpan< char > value, out int result)

References System.Net.Http.HttpRuleParser.GetQuotedStringLength(), System.length, System.ReadOnlySpan< T >.Slice(), System.startIndex, System.Net.Http.Headers.AltSvcHeaderParser.TryReadQuotedInt32Value(), System.Net.Http.Headers.AltSvcHeaderParser.TryReadQuotedValue(), and System.value.

Referenced by System.Net.Http.Headers.AltSvcHeaderParser.GetParsedValueLength().