Pierre Lamot created THRIFT-2308: ------------------------------------ Summary: 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
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)