You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by jm...@apache.org on 2016/06/02 21:51:51 UTC

[5/6] incubator-guacamole-client git commit: GUACAMOLE-44: Do not wait forever for streams to be notified.

GUACAMOLE-44: Do not wait forever for streams to be notified.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/0ba8da2d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/0ba8da2d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/0ba8da2d

Branch: refs/heads/master
Commit: 0ba8da2dd265898240699b3fe5a181b4ad45566a
Parents: d398509
Author: Michael Jumper <mj...@apache.org>
Authored: Thu Apr 14 17:47:34 2016 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Thu Jun 2 12:50:55 2016 -0700

----------------------------------------------------------------------
 .../apache/guacamole/tunnel/StreamInterceptingTunnel.java    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/0ba8da2d/guacamole/src/main/java/org/apache/guacamole/tunnel/StreamInterceptingTunnel.java
----------------------------------------------------------------------
diff --git a/guacamole/src/main/java/org/apache/guacamole/tunnel/StreamInterceptingTunnel.java b/guacamole/src/main/java/org/apache/guacamole/tunnel/StreamInterceptingTunnel.java
index a84a090..a9a1355 100644
--- a/guacamole/src/main/java/org/apache/guacamole/tunnel/StreamInterceptingTunnel.java
+++ b/guacamole/src/main/java/org/apache/guacamole/tunnel/StreamInterceptingTunnel.java
@@ -54,6 +54,12 @@ public class StreamInterceptingTunnel extends DelegatingGuacamoleTunnel {
     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,
      * reading and intercepting stream-related instructions as necessary to
      * fulfill calls to interceptStream().
@@ -319,7 +325,7 @@ public class StreamInterceptingTunnel extends DelegatingGuacamoleTunnel {
         synchronized (stream) {
             while (streams.get(indexString) == stream) {
                 try {
-                    stream.wait();
+                    stream.wait(STREAM_WAIT_TIMEOUT);
                 }
                 catch (InterruptedException e) {
                     // Ignore