From 3ac54cbdebca3ba4bf6a9e072c6151d20dc5c5a5 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 20 Jul 2020 17:03:29 +0200 Subject: Remove pointless code No need to mark removed clients as OFFLINE. Timeout handling will work just fine either way. --- src/main/java/de/bwlehrpool/bwlp_guac/AvailableClient.java | 4 ---- src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java | 5 ----- 2 files changed, 9 deletions(-) (limited to 'src') diff --git a/src/main/java/de/bwlehrpool/bwlp_guac/AvailableClient.java b/src/main/java/de/bwlehrpool/bwlp_guac/AvailableClient.java index aa7506d..75e93f3 100644 --- a/src/main/java/de/bwlehrpool/bwlp_guac/AvailableClient.java +++ b/src/main/java/de/bwlehrpool/bwlp_guac/AvailableClient.java @@ -169,10 +169,6 @@ public class AvailableClient implements Cloneable { return locationid; } - public void markAsMissing() { - this.state = State.OFFLINE; - } - public GuacamoleConfiguration toGuacConfig() { GuacamoleConfiguration cfg = new GuacamoleConfiguration(); cfg.setProtocol("vnc"); diff --git a/src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java b/src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java index c2d155a..6216389 100644 --- a/src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java +++ b/src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java @@ -249,7 +249,6 @@ public class ConnectionManager { LOGGER.info("Client list null"); } synchronized (clientPool) { - HashSet processedClients = new HashSet(); for (JsonClient cnew : root.clients) { if (cnew.password == null || cnew.clientip == null) continue; // Invalid @@ -286,14 +285,10 @@ public class ConnectionManager { } existing.update(cnew); } - processedClients.add(existing); } final long NOW = System.currentTimeMillis(); for (Iterator it = clientPool.values().iterator(); it.hasNext();) { AvailableClient c = it.next(); - if (!processedClients.contains(c)) { - c.markAsMissing(); - } if (c.isTimeout(NOW)) { LOGGER.info("Removing client " + c + " from list"); for (JsonGroup group : c.groupList) { -- cgit v1.2.3-55-g7522