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 2012/12/28 12:22:44 UTC

svn commit: r1426458 - /tomcat/trunk/java/org/apache/tomcat/websocket/WsFrame.java

Author: markt
Date: Fri Dec 28 11:22:44 2012
New Revision: 1426458

URL: http://svn.apache.org/viewvc?rev=1426458&view=rev
Log:
Remove a new String() that should have been removed when the decoder was added.

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

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsFrame.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsFrame.java?rev=1426458&r1=1426457&r2=1426458&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/WsFrame.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/WsFrame.java Fri Dec 28 11:22:44 2012
@@ -280,10 +280,10 @@ public class WsFrame {
                                 CloseCodes.PROTOCOL_ERROR,
                                 sm.getString("wsFrame.invalidUtf8Close")));
                     }
-                    reason = new String(controlBufferBinary.array(),
-                            controlBufferBinary.arrayOffset() +
-                                    controlBufferBinary.position(),
-                            controlBufferBinary.remaining(), "UTF8");
+                    // There will be no overflow as the output buffer is big
+                    // enough. There will be no underflow as all the data is
+                    // passed to the decoder in a single call.
+                    reason = controlBufferText.toString();
                 }
             }
             wsSession.onClose(



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