GUACAMOLE-102: Adding some commentary for changes in the RestrictedGuacamoleTunnelService class.

This commit is contained in:
Nick Couchman
2017-03-20 14:55:35 -04:00
committed by Nick Couchman
parent d1259ef8df
commit 2363c63e64

View File

@@ -190,11 +190,15 @@ public class RestrictedGuacamoleTunnelService
logger.debug("Calculating weights for connections {} and {}.", a.getName(), b.getName());
int cw = 0;
int weightA = a.getConnectionWeight();
// If the weight is null, we go ahead and sort, anyway
if (weightA == null)
weightA = 0;
// If the weight is null, we go ahead and sort, anyway
int weightB = b.getConnectionWeight();
if (weightB == null)
weightB = 0;
int connsA = getActiveConnections(a).size();
int connsB = getActiveConnections(b).size();
logger.debug("Connection {} has computed weight of {}.", a.getName(), connsA * 10000 / weightA);