]> source.dussan.org Git - archiva.git/commitdiff
force use of preemptive with last wagon snapshot
authorOlivier Lamy <olamy@apache.org>
Tue, 29 Jan 2013 11:17:18 +0000 (11:17 +0000)
committerOlivier Lamy <olamy@apache.org>
Tue, 29 Jan 2013 11:17:18 +0000 (11:17 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1439837 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java
pom.xml

index fdb934e14e63a5f5786d2a62862cd2a69a1f8bcb..c504bac5d6aba3cbca94fc456b93449a05a1304c 100644 (file)
@@ -45,6 +45,9 @@ import org.apache.maven.wagon.events.TransferEvent;
 import org.apache.maven.wagon.events.TransferListener;
 import org.apache.maven.wagon.proxy.ProxyInfo;
 import org.apache.maven.wagon.repository.Repository;
+import org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon;
+import org.apache.maven.wagon.shared.http4.HttpConfiguration;
+import org.apache.maven.wagon.shared.http4.HttpMethodConfiguration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -141,6 +144,16 @@ public class DownloadRemoteIndexTask
             wagon.setReadTimeout( timeoutInMilliseconds );
             wagon.setTimeout( timeoutInMilliseconds );
 
+            if ( wagon instanceof AbstractHttpClientWagon )
+            {
+                HttpConfiguration httpConfiguration = new HttpConfiguration();
+                HttpMethodConfiguration httpMethodConfiguration = new HttpMethodConfiguration();
+                httpMethodConfiguration.setUsePreemptive( true );
+                httpMethodConfiguration.setReadTimeout( timeoutInMilliseconds );
+                httpConfiguration.setGet( httpMethodConfiguration );
+                ( (AbstractHttpClientWagon) wagon ).setHttpConfiguration( httpConfiguration );
+            }
+
             wagon.addTransferListener( new DownloadListener() );
             ProxyInfo proxyInfo = null;
             if ( this.networkProxy != null )
diff --git a/pom.xml b/pom.xml
index ddfb996d4ac4f9a20816b5feb69bb4fbfca69e8a..1b8f2d8f0cc695f6af318dbb153a2ac6a29a1392 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -66,7 +66,7 @@
 
     <maven-model-converter.version>2.1</maven-model-converter.version>
     <maven.indexer.version>5.1.0</maven.indexer.version>
-    <wagon.version>2.2</wagon.version>
+    <wagon.version>2.4-SNAPSHOT</wagon.version>
     <redback.version>2.1-SNAPSHOT</redback.version>
     <redback.cache.version>2.1-SNAPSHOT</redback.cache.version>
     <redback.quartz.version>2.0</redback.quartz.version>