GUACAMOLE-38: Leave default port to individual protocols.

This commit is contained in:
Nick Couchman
2018-03-24 20:44:02 -04:00
parent 6c71f4ddb3
commit 5c96cd6326

View File

@@ -44,11 +44,6 @@ public class QCParser {
*/
public static final String DEFAULT_URI_HOST = "localhost";
/**
* The default port to use if one is not defined.
*/
public static final Integer DEFAULT_URI_PORT = 22;
/**
* Parse out a URI string and get a connection from that string,
* or an exception if the parsing fails.
@@ -89,9 +84,6 @@ public class QCParser {
if (host == null || host.equals(""))
host = DEFAULT_URI_HOST;
if (port == -1 || port < 1)
port = DEFAULT_URI_PORT;
if (query != null && !query.equals(""))
paramList = Arrays.asList(query.split("&"));
@@ -106,6 +98,8 @@ public class QCParser {
GuacamoleConfiguration qcConfig = new GuacamoleConfiguration();
qcConfig.setProtocol(protocol);
qcConfig.setParameter("hostname",host);
if (port > 0)
qcConfig.setParameter("port", Integer.toString(port));
if (username != null)