提交 fe086df9 编写于 作者: K kohsuke

Automated tool downloads are made more robust by using HTTP download retries.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@23122 71c3de6d-444a-0410-be80-ed276b4c234a
上级 25c3bcbf
......@@ -58,6 +58,7 @@ import org.apache.commons.io.IOUtils;
import org.apache.commons.io.input.CountingInputStream;
import org.apache.commons.fileupload.FileItem;
import org.kohsuke.stapler.Stapler;
import org.jvnet.robust_http_client.RetryableHttpStream;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
......@@ -557,7 +558,9 @@ public final class FilePath implements Serializable {
if(listener!=null)
listener.getLogger().println(message);
CountingInputStream cis = new CountingInputStream(con.getInputStream());
// for HTTP downloads, enable automatic retry for added resilience
InputStream in = archive.getProtocol().equals("http") ? new RetryableHttpStream(archive) : con.getInputStream();
CountingInputStream cis = new CountingInputStream(in);
try {
if(archive.toExternalForm().endsWith(".zip"))
unzipFrom(cis);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册