[ 
https://issues.apache.org/jira/browse/THRIFT-2308?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pierre Lamot closed THRIFT-2308.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 0.9.2

fixed by THRIFT-2205

> node: TJSONProtocol parse error when reading from buffered message
> ------------------------------------------------------------------
>
>                 Key: THRIFT-2308
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2308
>             Project: Thrift
>          Issue Type: Bug
>          Components: Node.js - Library
>    Affects Versions: 0.9.2
>            Reporter: Pierre Lamot
>             Fix For: 0.9.2
>
>         Attachments: 
> 0001-THRIFT-2308-node-detect-the-end-of-the-message-befor.patch
>
>
> Hello,
> The current implementation of TJSONProtocol in node uses 
> JSON.parse(this.trans.readAll()) to deserialize, it is working with 
> TFramedTransport because readAll, returns a sole message, but when using 
> TBufferedTransport several messages can be contained in the buffer. This 
> cause a parse error from JSON.parse because it starts to read the next 
> message as if it belongs to the first
> I think the solution is to either to:
>   - detect the end of the JSON and parse only the message chunck
>   - implement/use a JSON parse wich can use data stream (like its done in the 
> other languages)
> Best regards,
> Pierre



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to