szaszm commented on a change in pull request #791:
URL: https://github.com/apache/nifi-minifi-cpp/pull/791#discussion_r436606464



##########
File path: libminifi/src/core/ProcessSession.cpp
##########
@@ -469,6 +470,14 @@ void ProcessSession::import(std::string source, const 
std::shared_ptr<core::Flow
           invalidWrite = true;
         }
       }
+
+      io::BaseStream *stream = baseStream.get();
+      std::unique_ptr<io::CRCStream<io::BaseStream>> crcStream;
+      if (crc) {
+        crcStream = utils::make_unique<io::CRCStream<io::BaseStream>>(stream, 
*crc);
+        stream = crcStream.get();
+      }

Review comment:
       I thought a bit about this. There is a function similar to 
`ProcessSession::import` called `ProcessSession::importFrom` which takes an 
input stream instead of a file name. It doesn't support FlowFile delimiters, 
though.
   
   My idea is to extend `ProcessSession::importFrom` to support delimiters and 
use that with a `CRCStream` over a `FileStream`. If I understand correctly, we 
include every byte that we processed in the checksum, so the stream composition 
wouldn't change behavior, but correct me if I'm wrong.




----------------------------------------------------------------
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


Reply via email to