if (str1.equalsIgnoreCase("WWW-Authenticate"))
this.challengeState = ChallengeState.TARGET;
else if (str1.equalsIgnoreCase("Proxy-Authenticate"))
this.challengeState = ChallengeState.PROXY;
else
throw new MalformedChallengeException("Unexpected header name: " + str1);
CharArrayBuffer localCharArrayBuffer;
if ((paramHeader instanceof FormattedHeader))
{
localCharArrayBuffer = ((FormattedHeader)paramHeader).getBuffer();
str2 = ((FormattedHeader)paramHeader).getValuePos();
}
else
{
str3 = paramHeader.getValue();
if (str3 == null)
throw new MalformedChallengeException("Header value is null");
localCharArrayBuffer = new CharArrayBuffer(str3.length());
localCharArrayBuffer.append(str3);
}
for (String str2 = 0; (str2 < localCharArrayBuffer.length()) && (HTTP.isWhitespace(localCharArrayBuffer.charAt(str2))); str2++);
String str3 = str2;
while ((str2 < localCharArrayBuffer.length()) && (!HTTP.isWhitespace(localCharArrayBuffer.charAt(str2))))
str2++;
int i = str2;
String str4 = localCharArrayBuffer.substring(str3, i);
if (!str4.equalsIgnoreCase(getSchemeName()))
throw new MalformedChallengeException("Invalid scheme identifier: " + str4);
parseChallenge(localCharArrayBuffer, str2, localCharArrayBuffer.length());
}