mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
GUACAMOLE-44: Use StreamInterceptingTunnel for absolutely all tunnels.
This commit is contained in:
@@ -23,11 +23,11 @@ import java.util.Collections;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import org.apache.guacamole.GuacamoleException;
|
|
||||||
import org.apache.guacamole.environment.Environment;
|
import org.apache.guacamole.environment.Environment;
|
||||||
import org.apache.guacamole.net.GuacamoleTunnel;
|
import org.apache.guacamole.net.GuacamoleTunnel;
|
||||||
import org.apache.guacamole.net.auth.AuthenticatedUser;
|
import org.apache.guacamole.net.auth.AuthenticatedUser;
|
||||||
import org.apache.guacamole.net.auth.UserContext;
|
import org.apache.guacamole.net.auth.UserContext;
|
||||||
|
import org.apache.guacamole.tunnel.StreamInterceptingTunnel;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@@ -58,7 +58,8 @@ public class GuacamoleSession {
|
|||||||
/**
|
/**
|
||||||
* All currently-active tunnels, indexed by tunnel UUID.
|
* All currently-active tunnels, indexed by tunnel UUID.
|
||||||
*/
|
*/
|
||||||
private final Map<String, GuacamoleTunnel> tunnels = new ConcurrentHashMap<String, GuacamoleTunnel>();
|
private final Map<String, StreamInterceptingTunnel> tunnels =
|
||||||
|
new ConcurrentHashMap<String, StreamInterceptingTunnel>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The last time this session was accessed.
|
* The last time this session was accessed.
|
||||||
@@ -156,7 +157,7 @@ public class GuacamoleSession {
|
|||||||
*
|
*
|
||||||
* @return A map of all active tunnels associated with this session.
|
* @return A map of all active tunnels associated with this session.
|
||||||
*/
|
*/
|
||||||
public Map<String, GuacamoleTunnel> getTunnels() {
|
public Map<String, StreamInterceptingTunnel> getTunnels() {
|
||||||
return tunnels;
|
return tunnels;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,7 +167,7 @@ public class GuacamoleSession {
|
|||||||
*
|
*
|
||||||
* @param tunnel The tunnel to associate with this session.
|
* @param tunnel The tunnel to associate with this session.
|
||||||
*/
|
*/
|
||||||
public void addTunnel(GuacamoleTunnel tunnel) {
|
public void addTunnel(StreamInterceptingTunnel tunnel) {
|
||||||
tunnels.put(tunnel.getUUID().toString(), tunnel);
|
tunnels.put(tunnel.getUUID().toString(), tunnel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,9 @@ import com.google.inject.Inject;
|
|||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.guacamole.GuacamoleException;
|
import org.apache.guacamole.GuacamoleException;
|
||||||
import org.apache.guacamole.GuacamoleException;
|
|
||||||
import org.apache.guacamole.GuacamoleSecurityException;
|
|
||||||
import org.apache.guacamole.GuacamoleSecurityException;
|
import org.apache.guacamole.GuacamoleSecurityException;
|
||||||
import org.apache.guacamole.GuacamoleSession;
|
import org.apache.guacamole.GuacamoleSession;
|
||||||
import org.apache.guacamole.GuacamoleUnauthorizedException;
|
import org.apache.guacamole.GuacamoleUnauthorizedException;
|
||||||
import org.apache.guacamole.GuacamoleUnauthorizedException;
|
|
||||||
import org.apache.guacamole.net.DelegatingGuacamoleTunnel;
|
|
||||||
import org.apache.guacamole.net.GuacamoleTunnel;
|
import org.apache.guacamole.net.GuacamoleTunnel;
|
||||||
import org.apache.guacamole.net.auth.Connection;
|
import org.apache.guacamole.net.auth.Connection;
|
||||||
import org.apache.guacamole.net.auth.ConnectionGroup;
|
import org.apache.guacamole.net.auth.ConnectionGroup;
|
||||||
@@ -242,7 +238,7 @@ public class TunnelRequestService {
|
|||||||
throws GuacamoleException {
|
throws GuacamoleException {
|
||||||
|
|
||||||
// Monitor tunnel closure and data
|
// Monitor tunnel closure and data
|
||||||
GuacamoleTunnel monitoredTunnel = new DelegatingGuacamoleTunnel(tunnel) {
|
StreamInterceptingTunnel monitoredTunnel = new StreamInterceptingTunnel(tunnel) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The time the connection began, measured in milliseconds since
|
* The time the connection began, measured in milliseconds since
|
||||||
|
Reference in New Issue
Block a user