[jbossweb-commits] JBossWeb SVN: r2275 - in branches/7.4.x/src/main/java/org/apache/tomcat/websocket: server and 1 other directory.
jbossweb-commits at lists.jboss.org
jbossweb-commits at lists.jboss.org
Wed Oct 9 02:59:39 EDT 2013
Author: remy.maucherat at jboss.com
Date: 2013-10-09 02:59:38 -0400 (Wed, 09 Oct 2013)
New Revision: 2275
Modified:
branches/7.4.x/src/main/java/org/apache/tomcat/websocket/WsFrameBase.java
branches/7.4.x/src/main/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java
Log:
Port ws logic fixes.
Modified: branches/7.4.x/src/main/java/org/apache/tomcat/websocket/WsFrameBase.java
===================================================================
--- branches/7.4.x/src/main/java/org/apache/tomcat/websocket/WsFrameBase.java 2013-10-03 14:00:02 UTC (rev 2274)
+++ branches/7.4.x/src/main/java/org/apache/tomcat/websocket/WsFrameBase.java 2013-10-09 06:59:38 UTC (rev 2275)
@@ -261,14 +261,16 @@
private boolean processData() throws IOException {
- checkRoomPayload();
+ boolean result;
if (Util.isControl(opCode)) {
- return processDataControl();
+ result = processDataControl();
} else if (textMessage) {
- return processDataText();
+ result = processDataText();
} else {
- return processDataBinary();
+ result = processDataBinary();
}
+ checkRoomPayload();
+ return result;
}
Modified: branches/7.4.x/src/main/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java
===================================================================
--- branches/7.4.x/src/main/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java 2013-10-03 14:00:02 UTC (rev 2274)
+++ branches/7.4.x/src/main/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java 2013-10-09 06:59:38 UTC (rev 2275)
@@ -82,25 +82,18 @@
}
if (complete) {
wsWriteTimeout.unregister(this);
- // Explicit flush for compatibility with buffered streams
- sos.flush();
+ clearHandler(null);
if (close) {
close();
}
- // Setting the result marks this (partial) message as
- // complete which means the next one may be sent which
- // could update the value of the handler. Therefore, keep a
- // local copy before signalling the end of the (partial)
- // message.
- clearHandler(null);
break;
}
}
} catch (IOException ioe) {
wsWriteTimeout.unregister(this);
- close();
clearHandler(ioe);
+ close();
}
if (!complete) {
// Async write is in progress
@@ -143,6 +136,11 @@
private void clearHandler(Throwable t) {
+ // Setting the result marks this (partial) message as
+ // complete which means the next one may be sent which
+ // 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;
if (sh != null) {
More information about the jbossweb-commits
mailing list