summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java
index fe55e23779..5885e7b528 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java
@@ -471,12 +471,14 @@ public class TransportHttp extends HttpTransport implements WalkTransport,
if (authMethod == HttpAuthMethod.NONE)
throw new TransportException(uri, MessageFormat.format(
JGitText.get().authenticationNotSupported, uri));
- if (1 < authAttempts
- || !authMethod.authorize(uri,
- getCredentialsProvider())) {
+ CredentialsProvider credentialsProvider = getCredentialsProvider();
+ if (3 < authAttempts
+ || !authMethod.authorize(uri, credentialsProvider)) {
+ credentialsProvider.reset(uri);
throw new TransportException(uri,
JGitText.get().notAuthorized);
}
+ credentialsProvider.reset(uri);
authAttempts++;
continue;
@@ -504,7 +506,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport,
/**
* Open an HTTP connection.
- *
+ *
* @param method
* @param u
* @return the connection