return;
}
-
-
- Log(LogNotice, "ExternalCommandListener", "Client connected");
+ Log(LogDebug, "ExternalCommandListener", "Client connected");
Utility::QueueAsyncCallback(boost::bind(&ExternalCommandListener::ClientHandler, this, commandPath, fd));
} catch (std::exception&) {
Log(LogCritical, "ExternalCommandListener", "Cannot accept new connection.");
String command = line;
+ if (command.IsEmpty()) {
+ fclose(fp);
+ return;
+ }
+
+ /* check if line contains [$unixts] */
+ if (line[0] != '[' || line[11] != ']') {
+ Log(LogDebug, "ExternalCommandListener", "Cannot find timestamp prefix in external command '" + command + "'. Bailing out.");
+ delete line;
+ fclose(fp);
+ return;
+ }
+
try {
Log(LogInformation, "ExternalCommandListener", "Executing external command: " + command);
std::ostringstream msgbuf;
msgbuf << "External command failed.";
Log(LogWarning, "ExternalCommandListener", msgbuf.str());
- return;
}
delete line;