hawq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From interma <...@git.apache.org>
Subject [GitHub] incubator-hawq pull request #1377: HAWQ-1627. Support setting the max protoc...
Date Fri, 22 Jun 2018 02:11:15 GMT
Github user interma commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1377#discussion_r197324064
  
    --- Diff: depends/libhdfs3/src/rpc/RpcChannel.cpp ---
    @@ -768,7 +771,15 @@ void RpcChannelImpl::readOneResponse(bool writeLock) {
         buffer.resize(headerSize);
         in->readFully(&buffer[0], headerSize, readTimeout);
     
    -    if (!curRespHeader.ParseFromArray(&buffer[0], headerSize)) {
    +    // use CodedInputStream around the buffer, so we can set TotalBytesLimit on it
    +    ArrayInputStream ais(&buffer[0], headerSize);
    +    CodedInputStream cis(&ais);
    +    cis.SetTotalBytesLimit(maxLength, maxLength/2);
    +
    +    // use ParseFromCodedStream instead of ParseFromArray, so it can consume the above
CodedInputStream
    +    //
    +    // if just use ParseFromArray, we have on chance to set TotalBytesLimit (64MB default)
    --- End diff --
    
    Thanks! I will fix.


---

Mime
View raw message