martinzink commented on code in PR #2148:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2148#discussion_r3008229315
##########
extensions/mqtt/processors/ConsumeMQTT.cpp:
##########
@@ -163,21 +163,21 @@ std::queue<ConsumeMQTT::SmartMessage>
ConsumeMQTT::getReceivedMqttMessages() {
return msg_queue;
}
-int64_t ConsumeMQTT::WriteCallback::operator() (const
std::shared_ptr<io::OutputStream>& stream) {
+io::IoResult ConsumeMQTT::WriteCallback::operator() (const
std::shared_ptr<io::OutputStream>& stream) {
if (message_.contents->payloadlen < 0) {
success_status_ = false;
logger_->log_error("Payload length of message is negative, value is [{}]",
message_.contents->payloadlen);
- return -1;
+ return io::IoResult::error();
}
- const auto len =
stream->write(reinterpret_cast<uint8_t*>(message_.contents->payload),
gsl::narrow<size_t>(message_.contents->payloadlen));
+ const size_t len =
stream->write(reinterpret_cast<uint8_t*>(message_.contents->payload),
gsl::narrow<size_t>(message_.contents->payloadlen));
if (io::isError(len)) {
success_status_ = false;
logger_->log_error("Stream writing error when processing message");
- return -1;
+ return io::IoResult::error();
}
- return gsl::narrow<int64_t>(len);
+ return io::IoResult::fromSizeT(gsl::narrow<int64_t>(len));
Review Comment:
fixed
https://github.com/apache/nifi-minifi-cpp/pull/2148/changes/d0cc52597cee192b10d9f46d08340029f6a8c6d5#diff-bcdc140bec3984114489502b01dfea7dd83390b110643ce0ebd3aefbb81d6badR180
--
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]