mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-38: Leave default port to individual protocols.
This commit is contained in:
@@ -44,11 +44,6 @@ public class QCParser {
|
|||||||
*/
|
*/
|
||||||
public static final String DEFAULT_URI_HOST = "localhost";
|
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,
|
* Parse out a URI string and get a connection from that string,
|
||||||
* or an exception if the parsing fails.
|
* or an exception if the parsing fails.
|
||||||
@@ -89,9 +84,6 @@ public class QCParser {
|
|||||||
if (host == null || host.equals(""))
|
if (host == null || host.equals(""))
|
||||||
host = DEFAULT_URI_HOST;
|
host = DEFAULT_URI_HOST;
|
||||||
|
|
||||||
if (port == -1 || port < 1)
|
|
||||||
port = DEFAULT_URI_PORT;
|
|
||||||
|
|
||||||
if (query != null && !query.equals(""))
|
if (query != null && !query.equals(""))
|
||||||
paramList = Arrays.asList(query.split("&"));
|
paramList = Arrays.asList(query.split("&"));
|
||||||
|
|
||||||
@@ -106,7 +98,9 @@ public class QCParser {
|
|||||||
GuacamoleConfiguration qcConfig = new GuacamoleConfiguration();
|
GuacamoleConfiguration qcConfig = new GuacamoleConfiguration();
|
||||||
qcConfig.setProtocol(protocol);
|
qcConfig.setProtocol(protocol);
|
||||||
qcConfig.setParameter("hostname",host);
|
qcConfig.setParameter("hostname",host);
|
||||||
qcConfig.setParameter("port", Integer.toString(port));
|
|
||||||
|
if (port > 0)
|
||||||
|
qcConfig.setParameter("port", Integer.toString(port));
|
||||||
|
|
||||||
if (username != null)
|
if (username != null)
|
||||||
qcConfig.setParameter("username", username);
|
qcConfig.setParameter("username", username);
|
||||||
|
Reference in New Issue
Block a user