[ 
https://issues.apache.org/jira/browse/THRIFT-2923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14263864#comment-14263864
 ] 

Hudson commented on THRIFT-2923:
--------------------------------

SUCCESS: Integrated in Thrift #1424 (See 
[https://builds.apache.org/job/Thrift/1424/])
THRIFT-2923 Initialise tpos and tstack in the Protocol constructor so writing 
to a protocol without a message does not fail. (roger: rev 
1d30558c8c09d08a60f6ddc602b6994cfc9f74b3)
* lib/js/src/thrift.js


> JavaScript client assumes a message being written
> -------------------------------------------------
>
>                 Key: THRIFT-2923
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2923
>             Project: Thrift
>          Issue Type: Bug
>          Components: JavaScript - Library
>    Affects Versions: 0.9.2
>            Reporter: Radoslaw Gruchalski
>            Priority: Minor
>
> I am working on a solution which uses Thrift directly, without embedded RPC 
> framework, it's sending messages via UDP. Currently being integrated into 
> Chrome Extension and I found a bug when doing the following:
> {noformat}
> var transport = new Thrift.TWebSocketTransport("http://dummy";);
> var protocol  = new Thrift.Protocol( transport );
> digest.write( protocol );
> {noformat}
> The error is:
> {noformat}
> Cannot read property 'push' of undefined.
> {noformat}
> The reason for this behaviour is:
> digest.write calls protocol.writeStructBegin which uses 
> this.tpos.push(this.tstack.length) in 
> https://github.com/apache/thrift/blob/master/lib/js/src/thrift.js#L778 but 
> tpos and tstack aren't defined unless writeMessageBegin is called in 
> https://github.com/apache/thrift/blob/master/lib/js/src/thrift.js#L751.
> Expected behaviour:
> tstack and tpos should be defined in the Protocol "constructor", here: 
> https://github.com/apache/thrift/blob/master/lib/js/src/thrift.js#L687.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to