apache/thrift — pull request #273 by cvlchinet (2014-11-17 22:35:32+00:00)
Title: 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.