bug CS-15179: ensure route before connecting

Reviewed-by: anthony
This commit is contained in:
Kelven Yang 2012-06-01 11:36:16 -07:00
parent d0bdab98ae
commit ef4f0c695a

View File

@ -70,6 +70,8 @@ public class ConsoleProxyVncClient extends ConsoleProxyClientBase {
if(tunnelUrl != null && !tunnelUrl.isEmpty() && tunnelSession != null && !tunnelSession.isEmpty()) {
URI uri = new URI(tunnelUrl);
s_logger.info("Connect to VNC server via tunnel. url: " + tunnelUrl + ", session: " + tunnelSession);
ConsoleProxy.ensureRoute(uri.getHost());
client.connectTo(
uri.getHost(), uri.getPort(),
uri.getPath() + "?" + uri.getQuery(),
@ -77,6 +79,7 @@ public class ConsoleProxyVncClient extends ConsoleProxyClientBase {
getClientHostPassword());
} else {
s_logger.info("Connect to VNC server directly. host: " + getClientHostAddress() + ", port: " + getClientHostPort());
ConsoleProxy.ensureRoute(getClientHostAddress());
client.connectTo(getClientHostAddress(), getClientHostPort(), getClientHostPassword());
}
} catch (UnknownHostException e) {