tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1777619 - in /tomcat/trunk: java/org/apache/tomcat/websocket/server/WsFrameServer.java webapps/docs/changelog.xml
Date Fri, 06 Jan 2017 14:45:03 GMT
Author: markt
Date: Fri Jan  6 14:45:03 2017
New Revision: 1777619

URL: http://svn.apache.org/viewvc?rev=1777619&view=rev
Log:
Partial revert of r1534619.
The caller has to be able to differentiate between no data and EOF.

Modified:
    tomcat/trunk/java/org/apache/tomcat/websocket/server/WsFrameServer.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/WsFrameServer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/WsFrameServer.java?rev=1777619&r1=1777618&r2=1777619&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/server/WsFrameServer.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/server/WsFrameServer.java Fri Jan  6 14:45:03
2017
@@ -16,6 +16,7 @@
  */
 package org.apache.tomcat.websocket.server;
 
+import java.io.EOFException;
 import java.io.IOException;
 import java.nio.ByteBuffer;
 
@@ -61,7 +62,9 @@ public class WsFrameServer extends WsFra
             inputBuffer.position(inputBuffer.limit()).limit(inputBuffer.capacity());
             int read = socketWrapper.read(false, inputBuffer);
             inputBuffer.limit(inputBuffer.position()).reset();
-            if (read <= 0) {
+            if (read < 0) {
+                throw new EOFException();
+            } else if (read == 0) {
                 return;
             }
             if (log.isDebugEnabled()) {

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1777619&r1=1777618&r2=1777619&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Fri Jan  6 14:45:03 2017
@@ -53,6 +53,14 @@
       </fix>
     </changelog>
   </subsection>
+  <subsection name="WebSocket">
+    <changelog>
+      <fix>
+        Prevent potential processing loop on unexpected WebSocket connection
+        closure. (markt)
+      </fix>
+    </changelog>
+  </subsection>
   <subsection name="Other">
     <changelog>
       <update>



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


Mime
View raw message