maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From micha...@apache.org
Subject [4/5] maven-wagon git commit: [WAGON-480] Non-threadsafe HttpClientContext is shared between threaded use of HttpClientWagon
Date Tue, 03 Jan 2017 21:13:35 GMT
[WAGON-480] Non-threadsafe HttpClientContext is shared between threaded use of HttpClientWagon

The HttpClientContext is created fresh with every execute(), guaranteeing
thread safety.


Project: http://git-wip-us.apache.org/repos/asf/maven-wagon/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-wagon/commit/1a005f1c
Tree: http://git-wip-us.apache.org/repos/asf/maven-wagon/tree/1a005f1c
Diff: http://git-wip-us.apache.org/repos/asf/maven-wagon/diff/1a005f1c

Branch: refs/heads/master
Commit: 1a005f1c3fe7492c10b06567738453118f1c15b6
Parents: 4074598
Author: Michael Osipov <michaelo@apache.org>
Authored: Wed Dec 28 01:20:07 2016 +0100
Committer: Michael Osipov <michaelo@apache.org>
Committed: Tue Jan 3 22:12:24 2017 +0100

----------------------------------------------------------------------
 .../maven/wagon/providers/http/AbstractHttpClientWagon.java  | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/1a005f1c/wagon-providers/wagon-http/src/main/java/org/apache/maven/wagon/providers/http/AbstractHttpClientWagon.java
----------------------------------------------------------------------
diff --git a/wagon-providers/wagon-http/src/main/java/org/apache/maven/wagon/providers/http/AbstractHttpClientWagon.java
b/wagon-providers/wagon-http/src/main/java/org/apache/maven/wagon/providers/http/AbstractHttpClientWagon.java
index d38506f..9ef9544 100755
--- a/wagon-providers/wagon-http/src/main/java/org/apache/maven/wagon/providers/http/AbstractHttpClientWagon.java
+++ b/wagon-providers/wagon-http/src/main/java/org/apache/maven/wagon/providers/http/AbstractHttpClientWagon.java
@@ -383,8 +383,6 @@ public abstract class AbstractHttpClientWagon
 
     private AuthCache authCache;
 
-    private HttpClientContext localContext;
-
     private Closeable closeable;
 
     /**
@@ -414,11 +412,8 @@ public abstract class AbstractHttpClientWagon
     {
         repository.setUrl( getURL( repository ) );
 
-        localContext = HttpClientContext.create();
         credentialsProvider = new BasicCredentialsProvider();
         authCache = new BasicAuthCache();
-        localContext.setCredentialsProvider( credentialsProvider );
-        localContext.setAuthCache( authCache );
 
         if ( authenticationInfo != null )
         {
@@ -788,6 +783,9 @@ public abstract class AbstractHttpClientWagon
             requestConfigBuilder.setRedirectsEnabled( false );
         }
 
+        HttpClientContext localContext = HttpClientContext.create();
+        localContext.setCredentialsProvider( credentialsProvider );
+        localContext.setAuthCache( authCache );
         localContext.setRequestConfig( requestConfigBuilder.build() );
 
         if ( config != null && config.isUsePreemptive() )


Mime
View raw message