adamdebreceni commented on a change in pull request #1028:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1028#discussion_r601279395
##########
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:
[this](http://manpages.org/archive_read_open2/3)
I-don't-know-how-trustworthy site says:
> On error, the read callback should invoke Fn archive_set_error to register
an error code and message and return -1.
--
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:
[email protected]