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

◆ GetRangeConditionLength()

static int System.Net.Http.Headers.RangeConditionHeaderValue.GetRangeConditionLength ( string input,
int startIndex,
out object parsedValue )
inlinestaticpackage

Definition at line 93 of file RangeConditionHeaderValue.cs.

94 {
95 parsedValue = null;
96 if (string.IsNullOrEmpty(input) || startIndex + 1 >= input.Length)
97 {
98 return 0;
99 }
100 int num = startIndex;
101 DateTimeOffset result = DateTimeOffset.MinValue;
102 EntityTagHeaderValue parsedValue2 = null;
103 char c = input[num];
104 char c2 = input[num + 1];
105 if (c == '"' || ((c == 'w' || c == 'W') && c2 == '/'))
106 {
107 int entityTagLength = EntityTagHeaderValue.GetEntityTagLength(input, num, out parsedValue2);
108 if (entityTagLength == 0)
109 {
110 return 0;
111 }
112 num += entityTagLength;
113 if (num != input.Length)
114 {
115 return 0;
116 }
117 }
118 else
119 {
120 if (!HttpDateParser.TryParse(input.AsSpan(num), out result))
121 {
122 return 0;
123 }
124 num = input.Length;
125 }
126 if (parsedValue2 == null)
127 {
128 parsedValue = new RangeConditionHeaderValue(result);
129 }
130 else
131 {
132 parsedValue = new RangeConditionHeaderValue(parsedValue2);
133 }
134 return num - startIndex;
135 }

References System.Net.Http.Headers.RangeConditionHeaderValue.RangeConditionHeaderValue(), System.Net.Http.Headers.EntityTagHeaderValue.GetEntityTagLength(), System.input, System.DateTimeOffset.MinValue, System.startIndex, and System.Net.HttpDateParser.TryParse().