HTTPCLIENT-1142: Infinite loop on NTLM authentication failure

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1197194 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2011-11-03 15:58:05 +00:00
parent 7541429cf2
commit ae8e671030
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,10 @@
Changes since 4.2 ALPHA1
-------------------
* [HTTPCLIENT-1142] Infinite loop on NTLM authentication failure.
Contributed by Oleg Kalnichevski <olegk at apache.org>
Release 4.2 ALPHA1
-------------------

View File

@ -105,6 +105,7 @@ public class HttpAuthenticator {
authState.reset();
break;
case CHALLENGED:
case HANDSHAKE:
if (authScheme == null) {
this.log.debug("Auth scheme is null");
authStrategy.authFailed(host, authState.getAuthScheme(), context);
@ -137,6 +138,9 @@ public class HttpAuthenticator {
}
Queue<AuthOption> authOptions = authStrategy.select(challenges, host, response, context);
if (authOptions != null && !authOptions.isEmpty()) {
if (this.log.isDebugEnabled()) {
this.log.debug("Selected authorization options: " + authOptions);
}
authState.setState(AuthProtocolState.CHALLENGED);
authState.update(authOptions);
return true;