You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ke...@apache.org on 2014/01/11 02:59:26 UTC

git commit: updated refs/heads/4.3 to b2d5e37

Updated Branches:
  refs/heads/4.3 343b6acae -> b2d5e374d


CLOUDSTACK-5734: Fix the regression caused by adding hyper-V support


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

Branch: refs/heads/4.3
Commit: b2d5e374d9dfb10475d49c2395ebb98fbcc13ce7
Parents: 343b6ac
Author: Kelven Yang <ke...@gmail.com>
Authored: Fri Jan 10 17:58:26 2014 -0800
Committer: Kelven Yang <ke...@gmail.com>
Committed: Fri Jan 10 17:58:48 2014 -0800

----------------------------------------------------------------------
 .../com/cloud/servlet/ConsoleProxyServlet.java  |  2 ++
 .../ConsoleProxyHttpHandlerHelper.java          | 35 ++++++++++++++++----
 2 files changed, 30 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b2d5e374/server/src/com/cloud/servlet/ConsoleProxyServlet.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/servlet/ConsoleProxyServlet.java b/server/src/com/cloud/servlet/ConsoleProxyServlet.java
index 8a55b39..796cb31 100644
--- a/server/src/com/cloud/servlet/ConsoleProxyServlet.java
+++ b/server/src/com/cloud/servlet/ConsoleProxyServlet.java
@@ -334,6 +334,8 @@ public class ConsoleProxyServlet extends HttpServlet {
                 }
             } else if (hostInfo.startsWith("instanceId")) {
                 host = hostInfo.substring(hostInfo.indexOf('=') + 1);
+            } else {
+                host = hostInfo;
             }
         } else {
             host = hostInfo;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b2d5e374/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyHttpHandlerHelper.java
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyHttpHandlerHelper.java b/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyHttpHandlerHelper.java
index 0facd3f..b5c9ce4 100644
--- a/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyHttpHandlerHelper.java
+++ b/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyHttpHandlerHelper.java
@@ -23,7 +23,7 @@ import com.cloud.consoleproxy.util.Logger;
 
 public class ConsoleProxyHttpHandlerHelper {
     private static final Logger s_logger = Logger.getLogger(ConsoleProxyHttpHandlerHelper.class);
-    
+
     public static Map<String, String> getQueryMap(String query) {
         String[] params = query.split("&");
         Map<String, String> map = new HashMap<String, String>();
@@ -43,26 +43,45 @@ public class ConsoleProxyHttpHandlerHelper {
                     s_logger.debug("Invalid paramemter in URL found. param: " + param);
             }
         }
-        
+
         // This is a ugly solution for now. We will do encryption/decryption translation
         // here to make it transparent to rest of the code.
         if(map.get("token") != null) {
             ConsoleProxyPasswordBasedEncryptor encryptor = new ConsoleProxyPasswordBasedEncryptor(
                 ConsoleProxy.getEncryptorPassword());
-    
+
             ConsoleProxyClientParam param = encryptor.decryptObject(ConsoleProxyClientParam.class, map.get("token"));
 
             // make sure we get information from token only
             guardUserInput(map);
             if(param != null) {
-                if(param.getClientHostAddress() != null)
+                if (param.getClientHostAddress() != null) {
+                    s_logger.debug("decode token. host: " + param.getClientHostAddress());
                     map.put("host", param.getClientHostAddress());
-                if(param.getClientHostPort() != 0)
+                } else {
+                    s_logger.error("decode token. host info is not found!");
+                }
+
+                if (param.getClientHostPort() != 0) {
+                    s_logger.debug("decode token. port: " + param.getClientHostPort());
                     map.put("port", String.valueOf(param.getClientHostPort()));
-                if(param.getClientTag() != null)
+                } else {
+                    s_logger.error("decode token. port info is not found!");
+                }
+
+                if (param.getClientTag() != null) {
+                    s_logger.debug("decode token. tag: " + param.getClientTag());
                     map.put("tag", param.getClientTag());
-                if(param.getClientHostPassword() != null)
+                } else {
+                    s_logger.error("decode token. tag info is not found!");
+                }
+
+                if (param.getClientHostPassword() != null) {
                     map.put("sid", param.getClientHostPassword());
+                } else {
+                    s_logger.error("decode token. sid info is not found!");
+                }
+
                 if(param.getClientTunnelUrl() != null)
                     map.put("consoleurl", param.getClientTunnelUrl());
                 if(param.getClientTunnelSession() != null)
@@ -77,6 +96,8 @@ public class ConsoleProxyHttpHandlerHelper {
                     map.put("username", param.getUsername());
                 if (param.getPassword() != null)
                     map.put("password", param.getPassword());
+            } else {
+                s_logger.error("Unable to decode token");
             }
         } else {
         	// we no longer accept information from parameter other than token