merlimat commented on a change in pull request #1129: Added end to end encryption in C++ client URL: https://github.com/apache/incubator-pulsar/pull/1129#discussion_r164524553
########## File path: pulsar-client-cpp/lib/ProducerImpl.cc ########## @@ -262,12 +295,21 @@ void ProducerImpl::sendAsync(const Message& msg, SendCallback callback) { SharedBuffer& payload = msg.impl_->payload; uint32_t uncompressedSize = payload.readableBytes(); + uint32_t compressedSize = uncompressedSize; if (!batchMessageContainer) { // If batching is enabled we compress all the payloads together before sending the batch payload = CompressionCodecProvider::getCodec(conf_.getCompressionType()).encode(payload); + compressedSize = payload.readableBytes(); + + // Encrypt the payload if enabled + SharedBuffer encryptedPayload; Review comment: Check whether it's required before creating the `SharedBuffer` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services