fgerlits commented on code in PR #1428:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1428#discussion_r992050245
##########
extensions/sftp/processors/FetchSFTP.cpp:
##########
@@ -122,11 +122,11 @@ void FetchSFTP::onTrigger(const
std::shared_ptr<core::ProcessContext> &context,
/* Download file */
try {
- session->write(flow_file, [&remote_file, &client](const
std::shared_ptr<io::BaseStream>& stream) -> int64_t {
+ session->write(flow_file, [&remote_file, &client, &flow_file](const
std::shared_ptr<io::OutputStream>& stream) -> int64_t {
if (!client->getFile(remote_file, *stream)) {
throw utils::SFTPException{client->getLastError()};
}
- return gsl::narrow<int64_t>(stream->size());
+ return gsl::narrow<int64_t>(flow_file->getSize());
Review Comment:
Looks good, thanks! I think the same thing should be done for `PutSFTP` and
`SFTPClient::putFile()`, but doesn't have to be in this pull request.
--
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]