You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by vn...@apache.org on 2017/06/16 01:08:34 UTC

[4/7] incubator-guacamole-client git commit: GUACAMOLE-317: Always prefer non-failover connections relative to failover-only connections.

GUACAMOLE-317: Always prefer non-failover connections relative to failover-only connections.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/3e5c2ba8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/3e5c2ba8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/3e5c2ba8

Branch: refs/heads/master
Commit: 3e5c2ba8d8e56282aa679a21f23cb73302d1712d
Parents: cdf823c
Author: Michael Jumper <mj...@apache.org>
Authored: Tue Jun 6 13:37:16 2017 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jun 6 17:32:38 2017 -0700

----------------------------------------------------------------------
 .../auth/jdbc/tunnel/RestrictedGuacamoleTunnelService.java  | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/3e5c2ba8/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/RestrictedGuacamoleTunnelService.java
----------------------------------------------------------------------
diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/RestrictedGuacamoleTunnelService.java b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/RestrictedGuacamoleTunnelService.java
index fa2c99f..19a625a 100644
--- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/RestrictedGuacamoleTunnelService.java
+++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/RestrictedGuacamoleTunnelService.java
@@ -187,6 +187,15 @@ public class RestrictedGuacamoleTunnelService
             @Override
             public int compare(ModeledConnection a, ModeledConnection b) {
 
+                // Always prefer non-failover connections to those which are
+                // failover-only
+                if (a.isFailoverOnly()) {
+                    if (!b.isFailoverOnly())
+                        return 1;
+                }
+                else if (b.isFailoverOnly())
+                    return -1;
+
                 // Active connections
                 int connA = getActiveConnections(a).size();
                 int connB = getActiveConnections(b).size();