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

◆ GetProtocolEndIndex()

static int System.Net.Http.Headers.ViaHeaderValue.GetProtocolEndIndex ( string input,
int startIndex,
out string protocolName,
out string protocolVersion )
inlinestaticprivate

Definition at line 161 of file ViaHeaderValue.cs.

162 {
163 protocolName = null;
164 protocolVersion = null;
165 int startIndex2 = startIndex;
166 int tokenLength = HttpRuleParser.GetTokenLength(input, startIndex2);
167 if (tokenLength == 0)
168 {
169 return 0;
170 }
171 startIndex2 = startIndex + tokenLength;
172 int whitespaceLength = HttpRuleParser.GetWhitespaceLength(input, startIndex2);
173 startIndex2 += whitespaceLength;
174 if (startIndex2 == input.Length)
175 {
176 return 0;
177 }
178 if (input[startIndex2] == '/')
179 {
180 protocolName = input.Substring(startIndex, tokenLength);
181 startIndex2++;
182 startIndex2 += HttpRuleParser.GetWhitespaceLength(input, startIndex2);
183 tokenLength = HttpRuleParser.GetTokenLength(input, startIndex2);
184 if (tokenLength == 0)
185 {
186 return 0;
187 }
188 protocolVersion = input.Substring(startIndex2, tokenLength);
189 startIndex2 += tokenLength;
190 whitespaceLength = HttpRuleParser.GetWhitespaceLength(input, startIndex2);
191 startIndex2 += whitespaceLength;
192 }
193 else
194 {
195 protocolVersion = input.Substring(startIndex, tokenLength);
196 }
197 if (whitespaceLength == 0)
198 {
199 return 0;
200 }
201 return startIndex2;
202 }

References System.Net.Http.HttpRuleParser.GetTokenLength(), System.Net.Http.HttpRuleParser.GetWhitespaceLength(), System.input, and System.startIndex.

Referenced by System.Net.Http.Headers.ViaHeaderValue.GetViaLength().