From b36e6106912ee2648cd6dd956040d957e39909d6 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 5 Nov 2021 15:46:52 +0100 Subject: [PATCH] better fake filename for http/tcp defs, follow openapi doc for global.types --- src/ebusd/mainloop.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ebusd/mainloop.cpp b/src/ebusd/mainloop.cpp index 2de5f184..90dc8697 100644 --- a/src/ebusd/mainloop.cpp +++ b/src/ebusd/mainloop.cpp @@ -1675,7 +1675,7 @@ result_t MainLoop::executeDefine(const vector& args, ostringstream* ostr time(&now); string errorDescription; istringstream defstr("#\n" + args[argPos]); // ensure first line is not used for determining col names - return m_messages->readFromStream(&defstr, "temporary", now, true, nullptr, &errorDescription, replace); + return m_messages->readFromStream(&defstr, "tcp", now, true, nullptr, &errorDescription, replace); } @@ -2105,7 +2105,7 @@ result_t MainLoop::executeGet(const vector& args, bool* connected, ostri if (ret == RESULT_OK && !newDefinition.empty()) { string errorDescription; istringstream defstr("#\n" + newDefinition); // ensure first line is not used for determining col names - ret = m_messages->readFromStream(&defstr, "temporary", now, true, nullptr, &errorDescription, true); + ret = m_messages->readFromStream(&defstr, "http", now, true, nullptr, &errorDescription, true); } if (ret == RESULT_OK) { bool first = true; @@ -2200,7 +2200,7 @@ result_t MainLoop::executeGet(const vector& args, bool* connected, ostri << ",\n \"masters\": " << m_busHandler->getMasterCount() << ",\n \"messages\": " << m_messages->size() << ",\n \"lastup\": " << static_cast(maxLastUp); - if (withDefinition) { + if (withDefinition && since <= 0) { *ostream << ",\n \"types\": ["; DataTypeList::getInstance()->dump(verbosity, true, ostream); *ostream << "\n ]";