tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1439679 - /tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameClient.java
Date Mon, 28 Jan 2013 22:42:49 GMT
Author: markt
Date: Mon Jan 28 22:42:48 2013
New Revision: 1439679

URL: http://svn.apache.org/viewvc?rev=1439679&view=rev
Log:
Look to see if a CloseReason is available before generating one.

Modified:
    tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameClient.java

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameClient.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameClient.java?rev=1439679&r1=1439678&r2=1439679&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameClient.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameClient.java Mon Jan 28 22:42:48 2013
@@ -68,8 +68,14 @@ public class WsFrameClient extends WsFra
 
 
     private final void close(Throwable t) {
-        CloseReason cr = new CloseReason(
+        CloseReason cr;
+        if (t instanceof WsIOException) {
+            cr = ((WsIOException) t).getCloseReason();
+        } else {
+            cr = new CloseReason(
                 CloseCodes.CLOSED_ABNORMALLY, t.getMessage());
+        }
+
         try {
             wsSession.close(cr);
         } catch (IOException ignore) {



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


Mime
View raw message