17 {
18 if (
string.IsNullOrEmpty(
value))
19 {
20 parsedValue = null;
21 return 0;
22 }
25 {
26 parsedValue = null;
27 return 0;
28 }
29 num += readLength;
30 if (result == "clear")
31 {
32 if (num !=
value.Length)
33 {
34 parsedValue = null;
35 return 0;
36 }
37 parsedValue = AltSvcHeaderValue.Clear;
39 }
40 if (num ==
value.Length ||
value[num++] !=
'=')
41 {
42 parsedValue = null;
43 return 0;
44 }
46 {
47 parsedValue = null;
48 return 0;
49 }
50 num += readLength2;
51 int? num2 = null;
52 bool persist = false;
53 while (num !=
value.Length)
54 {
56 {
57 }
58 if (num ==
value.Length)
59 {
60 parsedValue = null;
61 return 0;
62 }
64 {
65 default:
66 parsedValue = null;
67 return 0;
68 case ';':
69 {
71 {
72 }
73 int tokenLength = HttpRuleParser.GetTokenLength(
value, num);
74 if (tokenLength == 0)
75 {
76 parsedValue = null;
77 return 0;
78 }
79 if (num + tokenLength >=
value.Length ||
value[num + tokenLength] !=
'=')
80 {
81 parsedValue = null;
82 return 0;
83 }
84 if (tokenLength == 2 &&
value[num] ==
'm' &&
value[num + 1] ==
'a')
85 {
86 num += 3;
88 {
89 parsedValue = null;
90 return 0;
91 }
92 num2 = (num2.HasValue ? new int?(Math.Min(num2.GetValueOrDefault(), result2)) : new int?(result2));
93 num += readLength3;
94 }
95 else if (
value.AsSpan(num).StartsWith(
"persist="))
96 {
97 num += 8;
99 {
100 persist = result3 == 1;
101 }
103 {
104 parsedValue = null;
105 return 0;
106 }
107 num += readLength4;
108 }
109 else
110 {
111 num += tokenLength + 1;
113 {
114 parsedValue = null;
115 return 0;
116 }
117 num += readLength5;
118 }
119 continue;
120 }
121 case ',':
122 break;
123 }
124 break;
125 }
127 parsedValue = new AltSvcHeaderValue(result, host, port, maxAge, persist);
129 }