From 7fa30998b22b0a6e8fdbad26672429aa42f24cda Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 26 Mar 2014 18:15:01 -0700 Subject: [PATCH] GUAC-574: Only update active connections if socket not yet closed. --- .../net/auth/mysql/MySQLGuacamoleSocket.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java index f46035195..4200bfe5d 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java @@ -87,12 +87,15 @@ public class MySQLGuacamoleSocket implements GuacamoleSocket { @Override public void close() throws GuacamoleException { - // Close socket - socket.close(); - // Mark this connection as inactive synchronized (activeConnectionMap) { - activeConnectionMap.closeConnection(historyID, connectionGroupID); + + if (isOpen()) + activeConnectionMap.closeConnection(historyID, connectionGroupID); + + // Close socket + socket.close(); + } }