2012/12/27  <[email protected]>:
> Author: markt
> Date: Wed Dec 26 20:19:51 2012
> New Revision: 1426009
>
> URL: http://svn.apache.org/viewvc?rev=1426009&view=rev
> Log:
> Correctly set isText flag for text messages
>
> Modified:
>     tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpoint.java
>
> Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpoint.java
> URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpoint.java?rev=1426009&r1=1426008&r2=1426009&view=diff
> ==============================================================================
> --- tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpoint.java 
> (original)
> +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpoint.java Wed 
> Dec 26 20:19:51 2012
> @@ -100,7 +100,7 @@ public class WsRemoteEndpoint implements
>          }
>          sendMessage(Constants.OPCODE_TEXT, textToByte, first, isLast);
>          if (!isLast) {
> -            isText = Boolean.FALSE;
> +            isText = Boolean.TRUE;
>          }
>      }

It seems something is missing with the above "!isLast" condition.
If I am reading it correctly, you are allowed to call

(a)
  endpoint.sendString(..);
  endpoint.sendBytes(..);

In (a) both the calls have isLast==true and the "isText" flag remains null.

So, is there a reason why the following should be failing:

(b)
  endpoint.sendPartialString(text, false);
  endpoint.sendPartialString(text, true);
  endpoint.sendBytes(..);

If both (a) and (b) should be working, then there must be some code
that resets "isText" flag back to the value of null. E.g. for the
above it should be

>          if (isLast) {
>              isText = null;
>          } else {
>              isText = Boolean.TRUE;
>          }

If both (a) and (b) should be failing, then the flag should be
assigned unconditionally,

>              isText = Boolean.TRUE;

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to