martinzink commented on code in PR #2148:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2148#discussion_r3008226549


##########
extensions/aws/processors/PutS3Object.cpp:
##########
@@ -293,20 +293,19 @@ void PutS3Object::onTrigger(core::ProcessContext& 
context, core::ProcessSession&
   }
 
   std::optional<minifi::aws::s3::PutObjectResult> result;
-  session.read(flow_file, [this, &flow_file, &put_s3_request_params, 
&result](const std::shared_ptr<io::InputStream>& stream) -> int64_t {
+  session.read(flow_file, [this, &flow_file, &put_s3_request_params, 
&result](const std::shared_ptr<io::InputStream>& stream) -> io::IoResult {
     try {
       if (flow_file->getSize() <= multipart_threshold_) {
         logger_->log_info("Uploading S3 Object '{}' in a single upload", 
put_s3_request_params->object_key);
         result = s3_wrapper_.putObject(*put_s3_request_params, stream, 
flow_file->getSize());
-        return gsl::narrow<int64_t>(flow_file->getSize());
-      } else {
-        logger_->log_info("S3 Object '{}' passes the multipart threshold, 
uploading it in multiple parts", put_s3_request_params->object_key);
-        result = s3_wrapper_.putObjectMultipart(*put_s3_request_params, 
stream, flow_file->getSize(), multipart_size_);
-        return gsl::narrow<int64_t>(flow_file->getSize());
+        return io::IoResult::fromSizeT(flow_file->getSize());
       }
+      logger_->log_info("S3 Object '{}' passes the multipart threshold, 
uploading it in multiple parts", put_s3_request_params->object_key);
+      result = s3_wrapper_.putObjectMultipart(*put_s3_request_params, stream, 
flow_file->getSize(), multipart_size_);
+      return io::IoResult::fromSizeT(flow_file->getSize());

Review Comment:
   we dont support 32 bit builds, and if we were we would have this problem on 
a lot of different places (we use size_t in a bunch of places)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to