Author: markt Date: Thu Nov 21 09:11:07 2013 New Revision: 1544072 URL: http://svn.apache.org/r1544072 Log: Continuing the https://issues.apache.org/bugzilla/show_bug.cgi?id=55799 code review The check that only allowed control messages to be added to the queue is not valid so remove it. If a control message is sent in the middle of a sequence of text message parts when the current text part completes and the control message is sent there is a strong chance that the next text message part will need to be queued until the control message completes.
Modified: tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties?rev=1544072&r1=1544071&r2=1544072&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties Thu Nov 21 09:11:07 2013 @@ -57,7 +57,6 @@ wsRemoteEndpoint.closedWriter=This metho wsRemoteEndpoint.changeType=When sending a fragmented message, all fragments bust be of the same type wsRemoteEndpoint.concurrentMessageSend=Messages may not be sent concurrently even when using the asynchronous send messages. The client must wait for the previous message to complete before sending the next. wsRemoteEndpoint.flushOnCloseFailed=Flushing batched messages before closing the session failed -wsRemoteEndpoint.inProgress=Unexpected state. Please report a bug. Message will not be sent because the WebSocket session is currently sending another message wsRemoteEndpoint.invalidEncoder=The specified encoder of type [{0}] could not be instantiated wsRemoteEndpoint.noEncoder=No encoder specified for object of class [{0}] wsRemoteEndpoint.wrongState=The remote endpoint was in state [{0}] which is an invalid state for called method Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java?rev=1544072&r1=1544071&r2=1544072&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java Thu Nov 21 09:11:07 2013 @@ -258,14 +258,14 @@ public abstract class WsRemoteEndpointIm } } if (messagePartInProgress) { - // This must be a Control message else the state machine would - // have thrown an IllegalStateException. - // Leave the check in place for now. - // TODO Remove this check if there are no reports of problems - if (!Util.isControl(opCode)) { - throw new IllegalStateException( - sm.getString("wsRemoteEndpoint.inProgress")); - } + // When a control message is sent while another message is being + // the control message is queued. Chances are the subsequent + // data message part will end up queued while the control + // message is sent. The logic in this class (state machine, + // EndMessageHanlder, TextMessageSendHandler) ensures that there + // will only ever be one data message part in the queue. There + // could be multiple control messages in the queue. + // Add it to the queue messagePartQueue.add(mp); } else { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org