arpadboda commented on a change in pull request #637: MINIFICPP-1020 - PutFile 
fails to create empty files
URL: https://github.com/apache/nifi-minifi-cpp/pull/637#discussion_r319400821
 
 

 ##########
 File path: extensions/standard-processors/processors/PutFile.cpp
 ##########
 @@ -218,11 +218,24 @@ bool PutFile::putFile(core::ProcessSession *session, 
std::shared_ptr<FlowFileRec
     }
   }
 
-  ReadCallback cb(tmpFile, destFile);
-  session->read(flowFile, &cb);
+  bool success = false;
+
+  if (flowFile->getSize() > 0) {
 
 Review comment:
   In case there is no content of the flowfile, processsession::read is going 
to rollback:
   ```
       std::shared_ptr<io::BaseStream> stream = 
process_context_->getContentRepository()->read(claim);
   
       if (nullptr == stream) {
         rollback();
         return;
       }
   ```
   
   Which is fine in a way as you are trying to read something that doesn't 
exist. 
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to