Thrift: TMemoryBuffer::getBufferAsString only returns written portion.
(This change was by Adam, diff sent by email, I'm just checking it in.)
Blame Rev: 55988
Reviewed By: adam
Test Plan: Thrift compiles.
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665219 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/transport/TTransportUtils.h b/lib/cpp/src/transport/TTransportUtils.h
index 9499acd..518969f 100644
--- a/lib/cpp/src/transport/TTransportUtils.h
+++ b/lib/cpp/src/transport/TTransportUtils.h
@@ -319,7 +319,7 @@
if (buffer_ == NULL) {
return "";
}
- return std::string((char*)buffer_, (std::string::size_type)bufferSize_);
+ return std::string((char*)buffer_, (std::string::size_type)wPos_);
}
void appendBufferToString(std::string& str) {