Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 152175 Details for
Bug 295021
User is pummeled with back-to-back password request dialogs when he brings up the update manager
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Solution that alleviates the problem for me
patch_295021 (text/plain), 7.17 KB, created by
John Cortell
on 2009-11-13 12:35:57 EST
(
hide
)
Description:
Solution that alleviates the problem for me
Filename:
MIME Type:
Creator:
John Cortell
Created:
2009-11-13 12:35:57 EST
Size:
7.17 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ecf.provider.filetransfer.httpclient >Index: src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientFileSystemBrowser.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.ecf/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientFileSystemBrowser.java,v >retrieving revision 1.17 >diff -u -r1.17 HttpClientFileSystemBrowser.java >--- src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientFileSystemBrowser.java 26 Oct 2009 19:18:35 -0000 1.17 >+++ src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientFileSystemBrowser.java 13 Nov 2009 17:38:28 -0000 >@@ -18,13 +18,16 @@ > import java.net.URL; > import java.util.Iterator; > import org.apache.commons.httpclient.Credentials; >+import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler; > import org.apache.commons.httpclient.Header; > import org.apache.commons.httpclient.HostConfiguration; > import org.apache.commons.httpclient.HttpClient; >+import org.apache.commons.httpclient.HttpMethod; > import org.apache.commons.httpclient.UsernamePasswordCredentials; > import org.apache.commons.httpclient.auth.AuthScope; > import org.apache.commons.httpclient.auth.CredentialsProvider; > import org.apache.commons.httpclient.methods.HeadMethod; >+import org.apache.commons.httpclient.params.HttpMethodParams; > import org.apache.commons.httpclient.util.DateUtil; > import org.eclipse.core.runtime.Assert; > import org.eclipse.ecf.core.security.Callback; >@@ -196,6 +199,19 @@ > // set max-age for cache control to 0 for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=249990 > headMethod.addRequestHeader("Cache-Control", "max-age=0"); //$NON-NLS-1$//$NON-NLS-2$ > >+ // [bugzilla 295021] A connection attempt may prompt the user for a >+ // proxy userid/password. Don't drown him with back-to-back dialogs >+ // if the authentication fails. Unfortunately, we can't tell from here >+ // whether the authentication failed because he hit cancel or entered >+ // the wrong password. Ideally, in the latter case, we would retry. >+ HttpMethodParams params = new HttpMethodParams(); >+ params.setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler() { >+ public boolean retryMethod(final HttpMethod method, final IOException exception, int executionCount) { >+ return false; >+ } >+ }); >+ headMethod.setParams(params); >+ > long lastModified = 0; > long fileLength = -1; > connectingSockets.clear(); >Index: src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientRetrieveFileTransfer.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.ecf/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientRetrieveFileTransfer.java,v >retrieving revision 1.67 >diff -u -r1.67 HttpClientRetrieveFileTransfer.java >--- src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientRetrieveFileTransfer.java 26 Oct 2009 19:18:35 -0000 1.67 >+++ src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientRetrieveFileTransfer.java 13 Nov 2009 17:38:28 -0000 >@@ -20,11 +20,13 @@ > import java.util.Map; > import javax.net.SocketFactory; > import org.apache.commons.httpclient.Credentials; >+import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler; > import org.apache.commons.httpclient.Header; > import org.apache.commons.httpclient.HostConfiguration; > import org.apache.commons.httpclient.HttpClient; > import org.apache.commons.httpclient.HttpConnection; > import org.apache.commons.httpclient.HttpException; >+import org.apache.commons.httpclient.HttpMethod; > import org.apache.commons.httpclient.HttpState; > import org.apache.commons.httpclient.HttpStatus; > import org.apache.commons.httpclient.HttpVersion; >@@ -33,6 +35,7 @@ > import org.apache.commons.httpclient.auth.AuthScope; > import org.apache.commons.httpclient.auth.CredentialsProvider; > import org.apache.commons.httpclient.methods.GetMethod; >+import org.apache.commons.httpclient.params.HttpMethodParams; > import org.apache.commons.httpclient.protocol.Protocol; > import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; > import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory; >@@ -624,6 +627,18 @@ > // Define a CredentialsProvider - found that possibility while debugging in org.apache.commons.httpclient.HttpMethodDirector.processProxyAuthChallenge(HttpMethod) > // Seems to be another way to select the credentials. > getMethod.getParams().setParameter(CredentialsProvider.PROVIDER, credProvider); >+ >+ // [bugzilla 295021] A connection attempt may prompt the user for a >+ // proxy userid/password. Don't drown him with back-to-back dialogs >+ // if the authentication fails. Unfortunately, we can't tell from here >+ // whether the authentication failed because he hit cancel or entered >+ // the wrong password. Ideally, in the latter case, we would retry. >+ getMethod.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler() { >+ public boolean retryMethod(final HttpMethod method, final IOException exception, int executionCount) { >+ return false; >+ } >+ }); >+ > setRequestHeaderValues(); > > Trace.trace(Activator.PLUGIN_ID, "retrieve=" + urlString); //$NON-NLS-1$ >#P org.eclipse.equinox.p2.metadata.repository >Index: src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java,v >retrieving revision 1.19 >diff -u -r1.19 CacheManager.java >--- src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java 20 Oct 2009 18:17:30 -0000 1.19 >+++ src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java 13 Nov 2009 17:38:29 -0000 >@@ -135,11 +135,12 @@ > throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_AUTHENTICATION, NLS.bind(Messages.CacheManager_AuthenticationFaileFor_0, repositoryLocation), null)); > } catch (CoreException e) { > useJar = false; >- // give up on a timeout - if we did not get a 404 on the jar, we will just prolong the pain >+ // give up on a timeout or socket failure - if we did not get a 404 on the jar, we will just prolong the pain > // by (almost certainly) also timing out on the xml. > if (e.getStatus() != null && e.getStatus().getException() != null) { > Throwable ex = e.getStatus().getException(); >- if (ex.getClass() == java.net.SocketTimeoutException.class) >+ final Class exClass = ex.getClass(); >+ if (exClass == java.net.SocketTimeoutException.class || exClass == java.net.SocketException.class) > throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_READ, NLS.bind(Messages.CacheManager_FailedCommunicationWithRepo_0, repositoryLocation), ex)); > } > } catch (OperationCanceledException e) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 295021
:
152110
|
152115
| 152175 |
152361
|
152430
|
163407
|
163412