private static bool TryReadAgent(string input, int startIndex, ref int current, out string agent)
{
agent = null;
int agentLength = HttpRuleParser.GetHostLength(input, startIndex, true, out agent);
if (agentLength == 0)
{
return false;
}
current = current + agentLength;
int whitespaceLength = HttpRuleParser.GetWhitespaceLength(input, current);
current = current + whitespaceLength;
// At least one whitespace required after <agent>. Also make sure we have characters left for <text>
if ((whitespaceLength == 0) || (current == input.Length))
{
return false;
}
return true;
}