GUACAMOLE-5: Do not attempt to join a closed connection.

This commit is contained in:
Michael Jumper
2016-07-21 15:16:34 -07:00
parent 43761ef482
commit 702441d720
2 changed files with 3 additions and 7 deletions

View File

@@ -467,7 +467,7 @@ public abstract class AbstractGuacamoleTunnelService implements GuacamoleTunnelS
// Verify that the connection ID is known // Verify that the connection ID is known
String connectionID = activeConnection.getConnectionID(); String connectionID = activeConnection.getConnectionID();
if (connectionID == null) if (!activeConnection.isActive() || connectionID == null)
throw new GuacamoleResourceNotFoundException("No existing connection to be joined."); throw new GuacamoleResourceNotFoundException("No existing connection to be joined.");
// Build configuration from the sharing profile and the ID of // Build configuration from the sharing profile and the ID of

View File

@@ -36,8 +36,7 @@ import org.apache.guacamole.protocol.ConfiguredGuacamoleSocket;
/** /**
* A connection record implementation that describes an active connection. As * A connection record implementation that describes an active connection. As
* the associated connection has not yet ended, getEndDate() will always return * the associated connection has not yet ended, getEndDate() will always return
* null, and isActive() will always return true. The associated start date will * null. The associated start date will be the time of this objects creation.
* be the time of this objects creation.
* *
* @author Michael Jumper * @author Michael Jumper
*/ */
@@ -325,10 +324,7 @@ public class ActiveConnectionRecord implements ConnectionRecord {
@Override @Override
public boolean isActive() { public boolean isActive() {
return tunnel != null && tunnel.isOpen();
// Active connections are active by definition
return true;
} }
/** /**