diff options
author | Olivier Lamy <olamy@apache.org> | 2013-01-29 11:17:18 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2013-01-29 11:17:18 +0000 |
commit | 809047b3d835d48638330f73e1eb89c9ca02998f (patch) | |
tree | 600f13d8fa1a82ea141e957f3b952ad10d42666a /archiva-modules/archiva-scheduler | |
parent | ff0b88ff6ee8ff8a4769c23c19a98972f427f0d2 (diff) | |
download | archiva-809047b3d835d48638330f73e1eb89c9ca02998f.tar.gz archiva-809047b3d835d48638330f73e1eb89c9ca02998f.zip |
force use of preemptive with last wagon snapshot
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1439837 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-scheduler')
-rw-r--r-- | archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java index fdb934e14..c504bac5d 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java @@ -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 ) |