You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2013/08/23 20:05:29 UTC

svn commit: r1516955 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java

Author: markt
Date: Fri Aug 23 18:05:29 2013
New Revision: 1516955

URL: http://svn.apache.org/r1516955
Log:
Hopefully fix some intermittent unit test failures in buildbot

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1516953

Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java?rev=1516955&r1=1516954&r2=1516955&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java Fri Aug 23 18:05:29 2013
@@ -188,11 +188,14 @@ public abstract class WsRemoteEndpointIm
 
     void sendPartialString(CharBuffer part, boolean last) throws IOException {
         try {
+            // Get the timeout before we send the message. The message may
+            // trigger a session close and depending on timing the client
+            // session may close before we can read the timeout.
+            long timeout = getBlockingSendTimeout();
             FutureToSendHandler f2sh = new FutureToSendHandler();
             TextMessageSendHandler tmsh = new TextMessageSendHandler(f2sh, part,
                     last, encoder, encoderBuffer, this);
             tmsh.write();
-            long timeout = getBlockingSendTimeout();
             if (timeout == -1) {
                 f2sh.get();
             } else {
@@ -210,10 +213,13 @@ public abstract class WsRemoteEndpointIm
 
     void startMessageBlock(byte opCode, ByteBuffer payload, boolean last)
             throws IOException {
+        // Get the timeout before we send the message. The message may
+        // trigger a session close and depending on timing the client
+        // session may close before we can read the timeout.
+        long timeout = getBlockingSendTimeout();
         FutureToSendHandler f2sh = new FutureToSendHandler();
         startMessage(opCode, payload, last, f2sh);
         try {
-            long timeout = getBlockingSendTimeout();
             if (timeout == -1) {
                 f2sh.get();
             } else {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org