Fix a bug in TPipedTransport that broke pipelining.
authorDavid Reiss <dreiss@apache.org>
Tue, 8 Apr 2008 05:07:26 +0000 (05:07 +0000)
committerDavid Reiss <dreiss@apache.org>
Tue, 8 Apr 2008 05:07:26 +0000 (05:07 +0000)
commit1ffb61beaafedb160a971732e599d5c6aa67a646
tree94838cab5fbde46ecb309827676b2c5c7fa14053
parentbbdb06eb24c3144d6f32f86c21910904013b89d9
Fix a bug in TPipedTransport that broke pipelining.

Previously, TPipedTransport wrote it's full buffer to the "pipe" and
fully reset its buffer on a readEnd.  This assumed that the buffer was
fully read at that point.  This is not the case if requests are pipelined.
This change makes it only pipe out the portion that has been read and
copy the unread portion to the beginning of the buffer.

Also add a test that verifies the new functionality.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665646 13f79535-47bb-0310-9956-ffa450edef68
lib/cpp/src/transport/TTransportUtils.h
test/Makefile.am
test/TPipedTransportTest.cpp [new file with mode: 0644]