[ https://issues.apache.org/jira/browse/THRIFT-2817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14215320#comment-14215320 ]
ASF GitHub Bot commented on THRIFT-2817: ---------------------------------------- GitHub user cvlchinet opened a pull request: https://github.com/apache/thrift/pull/273 Fixes THRIFT-2817 and THRIFT-2839 Current implementation of json protocols uses buffer peeks extensively. But in certain situations this causes the buffer to read beyond the json message, which stalls the whole connection. (THRIFT-2817) To test this fix I ported the integration tests from the nodejs thrift library to go. Those are comprehensive integration tests that tests the whole thrift stack. The tests revealed another problem in TFramedTransport. When calling TFramedTransport.Read, it should return remaining bytes, but it doesn't when passing a []byte that is bigger than the current frame_size. (THRIFT-2839) This PR fixes THRIFT-2817 and THRIFT-2839. You can merge this pull request into a Git repository by running: $ git pull https://github.com/cvlchinet/thrift go-fix-json Alternatively you can review and apply these changes as the patch at: https://github.com/apache/thrift/pull/273.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #273 ---- commit 550bb2d92cd7eb256a96d435cbc1f69437fe902b Author: Chi Vinh Le <c...@chinet.info> Date: 2014-11-17T22:19:04Z Smarter buffer peeking for json protocols commit 7f16c1dda2405029bf64e99312852d0740000d44 Author: Chi Vinh Le <c...@chinet.info> Date: 2014-11-17T22:19:42Z Fix bug in TFramedTransport commit 7710d32ee10136365f0cbe65c28e6565298f6b60 Author: Chi Vinh Le <c...@chinet.info> Date: 2014-11-17T22:20:25Z Add comprehensive integration tests for the whole stack ---- > TSimpleJSONProtocol reads beyond end of message > ----------------------------------------------- > > Key: THRIFT-2817 > URL: https://issues.apache.org/jira/browse/THRIFT-2817 > Project: Thrift > Issue Type: Bug > Components: Go - Library > Reporter: Chi Vinh Le > > The TSimpleJSONProtocol reads beyond end of message, which prevent processing > the message until more data arrives. > https://github.com/apache/thrift/pull/264 -- This message was sent by Atlassian JIRA (v6.3.4#6332)