Author: markt
Date: Tue Jul  2 13:23:05 2013
New Revision: 1498924

URL: http://svn.apache.org/r1498924
Log:
More refactoring

Modified:
    
tomcat/trunk/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java

Modified: 
tomcat/trunk/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java?rev=1498924&r1=1498923&r2=1498924&view=diff
==============================================================================
--- 
tomcat/trunk/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java
 (original)
+++ 
tomcat/trunk/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java
 Tue Jul  2 13:23:05 2013
@@ -96,9 +96,7 @@ public class WsRemoteEndpointImplServer 
                     // could update the value of the handler. Therefore, keep a
                     // local copy before signalling the end of the (partial)
                     // message.
-                    SendHandler sh = handler;
-                    handler = null;
-                    sh.onResult(new SendResult());
+                    clearHandler(null);
                     break;
                 }
             }
@@ -148,6 +146,10 @@ public class WsRemoteEndpointImplServer 
     private void clearHandler(Throwable t) {
         SendHandler sh = handler;
         handler = null;
-        sh.onResult(new SendResult(t));
+        if (t == null) {
+            sh.onResult(new SendResult());
+        } else {
+            sh.onResult(new SendResult(t));
+        }
     }
 }



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

Reply via email to