martinzink commented on code in PR #2148:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2148#discussion_r3013643964
##########
extensions/libarchive/FocusArchiveEntry.cpp:
##########
@@ -181,12 +181,7 @@ int64_t FocusArchiveEntry::ReadCallback::operator()(const
std::shared_ptr<io::In
if (res < ARCHIVE_OK) {
logger_->log_error("FocusArchiveEntry can't read header due to archive
error: {}", archive_error_string(input_archive.get()));
- return nlen;
- }
-
- if (res < ARCHIVE_WARN) {
- logger_->log_warn("FocusArchiveEntry got archive warning while reading
header: {}", archive_error_string(input_archive.get()));
- return nlen;
+ return io::IoResult::error();
Review Comment:
no, the zero change was unintentional, good catch 👍,
the warn part was removed because it was unreachable code (since ARCHIVE_OK
is 0 and ARCHIVE_WARNING is -20 iirc), we should probably redo this whole part
and ditch the less than operators and check every known error code because the
< WARN is also wrong because
```
#define ARCHIVE_EOF 1 /* Found end of archive. */
#define ARCHIVE_OK 0 /* Operation was successful. */
#define ARCHIVE_RETRY (-10) /* Retry might succeed. */
#define ARCHIVE_WARN (-20) /* Partial success. */
/* For example, if write_header "fails", then you can't push data. */
#define ARCHIVE_FAILED (-25) /* Current operation cannot complete. */
/* But if write_header is "fatal," then this archive is dead and useless. */
#define ARCHIVE_FATAL (-30) /* No more operations are possible. */
```
but again this seems out of the scope fo this PR, Ive created a JIRA ticket
so we could understand and handle the different returns correctly
[added TODO to remind for
MINIFICPP-2761](https://github.com/apache/nifi-minifi-cpp/pull/2148/commits/0417f390bbe1dae7a71a4eb08d2582c2dfc2e14c)[added
TODO to remind for
MINIFICPP-2761](https://github.com/apache/nifi-minifi-cpp/pull/2148/commits/0417f390bbe1dae7a71a4eb08d2582c2dfc2e14c)
https://issues.apache.org/jira/browse/MINIFICPP-2761
--
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]