Github user jeking3 commented on a diff in the pull request:
https://github.com/apache/thrift/pull/1128#discussion_r88805388
--- Diff: lib/cpp/src/thrift/transport/THeaderTransport.cpp ---
@@ -394,15 +411,19 @@ void THeaderTransport::setHeader(const string& key,
const string& value) {
writeHeaders_[key] = value;
}
-size_t THeaderTransport::getMaxWriteHeadersSize() const {
+uint32_t THeaderTransport::getMaxWriteHeadersSize() const {
size_t maxWriteHeadersSize = 0;
THeaderTransport::StringToStringMap::const_iterator it;
for (it = writeHeaders_.begin(); it != writeHeaders_.end(); ++it) {
// add sizes of key and value to maxWriteHeadersSize
// 2 varints32 + the strings themselves
maxWriteHeadersSize += 5 + 5 + (it->first).length() +
(it->second).length();
}
- return maxWriteHeadersSize;
+ if (maxWriteHeadersSize > std::numeric_limits<uint32_t>().max()) {
--- End diff --
Compiling in Win32 exposed additional warnings I will clean up. Thanks for
this comment! I am also going to build with Visual Studio 2015 in 32-bit and
64-bit to make sure they are all cleaned up. I have Win64 VS2010 building
without any warnings at this point. In addition I found that the tutorial
CMakeLists.txt assumes ZLIB is configured so I changed it to be conditional on
the ZLIB library.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---