fgerlits commented on code in PR #1753:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1753#discussion_r1559650942


##########
extensions/standard-processors/processors/ListenTCP.cpp:
##########
@@ -28,7 +28,13 @@ void ListenTCP::initialize() {
 }
 
 void ListenTCP::onSchedule(core::ProcessContext& context, 
core::ProcessSessionFactory&) {
-  startTcpServer(context, SSLContextService, ClientAuth);
+  auto delimiter_str = context.getProperty(MessageDelimiter).value_or("\n");
+  if (delimiter_str.empty()) {
+    logger_->log_warn("{} cannot be an empty string", MessageDelimiter.name);
+    delimiter_str = "\n";
+  }

Review Comment:
   This is OK, but it means that the only way to specify `\n` as the delimiter 
is to not set the property, or set it to empty. Setting `Message Delimiter` to 
`\n` explicitly (either in the lua config or in the C2 server) will not work, 
because minifi will receive two separate characters, `\` and `n`.
   
   If we want to support explicit `\n` (or `\t` etc) as the value of the 
Message Delimiter property, we need to use the 
`utils::string::parseCharacter()` function, as it is done in GetTCP and 
TailFile.



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

Reply via email to