You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ra...@apache.org on 2016/11/04 11:13:22 UTC

[1/3] git commit: updated refs/heads/master to 5511065

Repository: cloudstack
Updated Branches:
  refs/heads/master cdb494520 -> 5511065fc


SSVM downloader now handles redirects properly.

Previously it was using the HttpClient to make an initial request
to an ISO. This would follow redirects. Then it would make
another request using built-in Java URL and InputStream, which
doesn't follow redirects. This results in the ISO getting stuck
at 0% forever and also causing DOS effects.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/7a4220f1
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/7a4220f1
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/7a4220f1

Branch: refs/heads/master
Commit: 7a4220f17252d54a1b990c776d1378400652b0ab
Parents: 305400b
Author: jeff <je...@greenqloud.com>
Authored: Fri Jul 8 09:59:08 2016 +0000
Committer: jeff <je...@greenqloud.com>
Committed: Tue Nov 1 10:48:53 2016 +0000

----------------------------------------------------------------------
 .../src/com/cloud/storage/template/HttpTemplateDownloader.java | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7a4220f1/core/src/com/cloud/storage/template/HttpTemplateDownloader.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/template/HttpTemplateDownloader.java b/core/src/com/cloud/storage/template/HttpTemplateDownloader.java
index 76d1ac9..bdf4990 100644
--- a/core/src/com/cloud/storage/template/HttpTemplateDownloader.java
+++ b/core/src/com/cloud/storage/template/HttpTemplateDownloader.java
@@ -25,7 +25,6 @@ import java.io.InputStream;
 import java.io.RandomAccessFile;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.net.URL;
 import java.util.Date;
 
 import org.apache.cloudstack.utils.imagestore.ImageStoreUtil;
@@ -117,7 +116,7 @@ public class HttpTemplateDownloader extends ManagedContextRunnable implements Te
             request = new GetMethod(downloadUrl);
             request.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, myretryhandler);
             completionCallback = callback;
-            //this.request.setFollowRedirects(false);
+            this.request.setFollowRedirects(true);
 
             File f = File.createTempFile("dnld", "tmp_", new File(toDir));
 
@@ -232,8 +231,7 @@ public class HttpTemplateDownloader extends ManagedContextRunnable implements Te
                 remoteSize = maxTemplateSizeInBytes;
             }
 
-            URL url = new URL(getDownloadUrl());
-            InputStream in = url.openStream();
+            InputStream in = request.getResponseBodyAsStream();
 
             RandomAccessFile out = new RandomAccessFile(file, "rw");
             out.seek(localFileSize);


[2/3] git commit: updated refs/heads/master to 5511065

Posted by ra...@apache.org.
Merge pull request #1746 from greenqloud/pr-iso-follow-redirects-4.9

SSVM downloader now handles redirects properly.New version of #1607, opened against 4.9 so it can be forward merged.

**Original Description**
Previously it was using the HttpClient to make an initial request to an ISO. This would follow redirects. Then it would make another request using built-in Java URL and InputStream, which doesn't follow redirects. This results in the ISO getting stuck at 0% forever and also causing DOS effects.

* pr/1746:
  SSVM downloader now handles redirects properly.

Signed-off-by: Rajani Karuturi <ra...@accelerite.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f19a1631
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f19a1631
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f19a1631

Branch: refs/heads/master
Commit: f19a1631a5770d1806174e82bd32a1488a021a3f
Parents: 240f443 7a4220f
Author: Rajani Karuturi <ra...@accelerite.com>
Authored: Fri Nov 4 16:41:38 2016 +0530
Committer: Rajani Karuturi <ra...@accelerite.com>
Committed: Fri Nov 4 16:41:38 2016 +0530

----------------------------------------------------------------------
 .../src/com/cloud/storage/template/HttpTemplateDownloader.java | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



[3/3] git commit: updated refs/heads/master to 5511065

Posted by ra...@apache.org.
Merge release branch 4.9 to master

* 4.9:
  SSVM downloader now handles redirects properly.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5511065f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5511065f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5511065f

Branch: refs/heads/master
Commit: 5511065fc20787619d9cd0444a65a3155fc9c921
Parents: cdb4945 f19a163
Author: Rajani Karuturi <ra...@accelerite.com>
Authored: Fri Nov 4 16:41:59 2016 +0530
Committer: Rajani Karuturi <ra...@accelerite.com>
Committed: Fri Nov 4 16:41:59 2016 +0530

----------------------------------------------------------------------
 .../src/com/cloud/storage/template/HttpTemplateDownloader.java | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------