phrocker commented on a change in pull request #596: MINIFICPP-925 - Fix
TailFile hang on long lines
URL: https://github.com/apache/nifi-minifi-cpp/pull/596#discussion_r296861858
##########
File path: extensions/standard-processors/processors/LogAttribute.cpp
##########
@@ -137,33 +137,32 @@ void LogAttribute::onTrigger(const
std::shared_ptr<core::ProcessContext> &contex
message << "\n" << "Payload:" << "\n";
ReadCallback callback(flow->getSize());
session->read(flow, &callback);
- for (unsigned int i = 0, j = 0; i < callback.read_size_; i++) {
- message << std::hex << callback.buffer_[i];
- j++;
- if (j == 80) {
- message << '\n';
- j = 0;
- }
+
+ auto payload_hex = utils::StringUtils::to_hex(callback.buffer_.data(),
callback.buffer_.size());
+ for (size_t i = 0; i < payload_hex.size(); i += 80) {
Review comment:
Isn't this potentially missing a partial line?
----------------------------------------------------------------
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]
With regards,
Apache Git Services