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



##########
File path: extensions/libarchive/CompressContent.h
##########
@@ -190,16 +189,11 @@ class CompressContent: public core::Processor {
       return ret;
     }
 
-    static la_ssize_t archive_read(struct archive *arch, void *context, const 
void **buff) {
-      WriteCallback *callback = (WriteCallback *) context;
+    static la_ssize_t archive_read(struct archive*, void *context, const void 
**buff) {
+      auto *callback = (WriteCallback *) context;
       callback->session_->read(callback->flow_, &callback->readDecompressCb_);
-      if (callback->readDecompressCb_.read_size_ >= 0) {
-        *buff = callback->readDecompressCb_.buffer_;
-        return gsl::narrow<la_ssize_t>(callback->readDecompressCb_.read_size_);
-      } else {
-        archive_set_error(arch, EIO, "Error reading flowfile");
-        return -1;
-      }
+      *buff = callback->readDecompressCb_.buffer_;
+      return gsl::narrow<la_ssize_t>(callback->readDecompressCb_.read_size_);

Review comment:
       Good catch. The site lists the official man page contents in a web 
format, so I would say the contents are valid. I've mistakenly removed the 
error branch because after converting `read_size_` to `size_t`, it was a dead 
branch and I didn't realize `read_size_` comes from a stream read return value. 
Will fix and rename `read_size_` to `stream_read_result`.




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