diff options
author | Brian P. Hinz <bphinz@users.sf.net> | 2017-05-06 14:35:38 -0400 |
---|---|---|
committer | Brian P. Hinz <bphinz@users.sf.net> | 2017-05-06 14:37:33 -0400 |
commit | 2711b995e79349793b463a7726c84ebf2c305898 (patch) | |
tree | 662b80c50e1cc95a898feb4f66baf32f72154bc0 | |
parent | 91eef93b661bf12dbb7397e8cfc7373be4411456 (diff) | |
download | tigervnc-2711b995e79349793b463a7726c84ebf2c305898.tar.gz tigervnc-2711b995e79349793b463a7726c84ebf2c305898.zip |
Fix for issue #455
-rw-r--r-- | java/com/tigervnc/vncviewer/OptionsDialog.java | 2 | ||||
-rw-r--r-- | java/com/tigervnc/vncviewer/Tunnel.java | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/java/com/tigervnc/vncviewer/OptionsDialog.java b/java/com/tigervnc/vncviewer/OptionsDialog.java index a7c87784..186c1fca 100644 --- a/java/com/tigervnc/vncviewer/OptionsDialog.java +++ b/java/com/tigervnc/vncviewer/OptionsDialog.java @@ -616,6 +616,8 @@ class OptionsDialog extends Dialog { String sshPort = viaPortInput.getText(); String viaStr = sshUser.concat("@").concat(sshHost).concat(":").concat(sshPort); via.setParam(viaStr); + } else { + via.setParam(""); } extSSH.setParam(extSSHCheckbox.isSelected()); if (!sshClientInput.getText().isEmpty()) diff --git a/java/com/tigervnc/vncviewer/Tunnel.java b/java/com/tigervnc/vncviewer/Tunnel.java index 8d083f8e..2e19160a 100644 --- a/java/com/tigervnc/vncviewer/Tunnel.java +++ b/java/com/tigervnc/vncviewer/Tunnel.java @@ -58,17 +58,16 @@ public class Tunnel { String remoteHost; remotePort = cc.getServerPort(); - if (tunnel.getValue() && via.getValue().isEmpty()) { - gatewayHost = cc.getServerName(); - remoteHost = "localhost"; - } else { + gatewayHost = cc.getServerName(); + remoteHost = "localhost"; + if (!via.getValue().isEmpty()) { gatewayHost = getSshHost(); remoteHost = cc.getServerName(); } String pattern = extSSHArgs.getValue(); if (pattern == null || pattern.isEmpty()) { - if (tunnel.getValue()) + if (tunnel.getValue() && via.getValue().isEmpty()) pattern = System.getProperty("VNC_TUNNEL_CMD"); else pattern = System.getProperty("VNC_VIA_CMD"); @@ -207,7 +206,7 @@ public class Tunnel { int remotePort, int localPort, String pattern) throws Exception { if (pattern == null || pattern.length() < 1) { - if (tunnel.getValue()) + if (tunnel.getValue() && via.getValue().isEmpty()) pattern = DEFAULT_TUNNEL_TEMPLATE; else pattern = DEFAULT_VIA_TEMPLATE; @@ -240,7 +239,7 @@ public class Tunnel { if (pattern.charAt(i) == '%') { switch (pattern.charAt(++i)) { case 'H': - cmd += (tunnel.getValue() ? gatewayHost : remoteHost); + cmd += remoteHost; H_found = true; continue; case 'G': |