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/26 21:19:51 UTC

svn commit: r1426009 - /tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpoint.java

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;
         }
     }
 



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


Re: svn commit: r1426009 - /tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpoint.java

Posted by Mark Thomas <ma...@apache.org>.
On 27/12/2012 23:36, Konstantin Kolinko wrote:
> 2012/12/27  <ma...@apache.org>:
>> 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;
>>          }

Yes, a) and b) should worked. Fixed. Thanks for the review.

Mark


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


Re: svn commit: r1426009 - /tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpoint.java

Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/12/27  <ma...@apache.org>:
> 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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org