Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/Alf.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ class Alf : public AliceO2::Common::Program
maxFiles = static_cast<unsigned int>(std::stoul(mOptions.dimLogFileConfig.substr(start)));
}
}
alfDebugLog.setLogFile(path.c_str(), maxBytes, maxFiles, 1);
const char* debugLogFile = path.c_str();
if (path == "stdout") debugLogFile = NULL; // handle special string to set logs go to stdout
alfDebugLog.setLogFile(debugLogFile, maxBytes, maxFiles, 1);
alfDebugLog.setOutputFormat(SimpleLog::FormatOption::ShowTimeStamp | SimpleLog::FormatOption::ShowSeveritySymbol | SimpleLog::FormatOption::ShowMessage );
alfDebugLog.info("ALF starting");
} else {
Expand Down
10 changes: 7 additions & 3 deletions src/DimServices/DimServices.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,15 @@ void StringRpcServer::rpcHandler()
{
// build a safe string from DIM input. Parent method getString() is unsafe, not guarateed to be nul-terminated
std::string inputString;
if (auto data = getString(); data && getSize() > 0) {
inputString.assign(data, getSize());
{
auto data = getString();
auto size = getSize();
if (data && (size > 0)) {
inputString.assign(data, strnlen(data, size));
}
}

alfDebugLog.info("Request received on %s : %s",mServiceName.c_str(),inputString.c_str());
alfDebugLog.info("Request received on %s (%d bytes) :\n%s",mServiceName.c_str(), (int)getSize(), inputString.c_str());
try {
auto returnValue = mCallback(inputString);
setDataString(makeSuccessString(returnValue), *this);
Expand Down