mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
GUACAMOLE-44: Do not wait forever for streams to be notified.
This commit is contained in:
@@ -53,6 +53,12 @@ public class StreamInterceptingTunnel extends DelegatingGuacamoleTunnel {
|
|||||||
*/
|
*/
|
||||||
private static final Logger logger = LoggerFactory.getLogger(StreamInterceptingTunnel.class);
|
private static final Logger logger = LoggerFactory.getLogger(StreamInterceptingTunnel.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The maximum number of milliseconds to wait for notification that a
|
||||||
|
* stream has closed before explicitly checking for closure ourselves.
|
||||||
|
*/
|
||||||
|
private static final long STREAM_WAIT_TIMEOUT = 1000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new StreamInterceptingTunnel which wraps the given tunnel,
|
* Creates a new StreamInterceptingTunnel which wraps the given tunnel,
|
||||||
* reading and intercepting stream-related instructions as necessary to
|
* reading and intercepting stream-related instructions as necessary to
|
||||||
@@ -319,7 +325,7 @@ public class StreamInterceptingTunnel extends DelegatingGuacamoleTunnel {
|
|||||||
synchronized (stream) {
|
synchronized (stream) {
|
||||||
while (streams.get(indexString) == stream) {
|
while (streams.get(indexString) == stream) {
|
||||||
try {
|
try {
|
||||||
stream.wait();
|
stream.wait(STREAM_WAIT_TIMEOUT);
|
||||||
}
|
}
|
||||||
catch (InterruptedException e) {
|
catch (InterruptedException e) {
|
||||||
// Ignore
|
// Ignore
|
||||||
|
Reference in New Issue
Block a user