Do not attempt to update the auth state if not valid

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@627483 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2008-02-13 15:39:37 +00:00
parent c37994ffb2
commit 44cb5c03e0
2 changed files with 8 additions and 0 deletions

View File

@ -70,6 +70,10 @@ public class AuthState {
this.credentials = null;
}
public boolean isValid() {
return this.authScheme != null;
}
/**
* Assigns the given {@link AuthScheme authentication scheme}.
*

View File

@ -985,6 +985,10 @@ public class DefaultClientRequestDirector
final HttpHost host,
final CredentialsProvider credsProvider) {
if (!authState.isValid()) {
return;
}
String hostname = host.getHostName();
int port = host.getPort();
if (port < 0) {