mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 21:55:03 +02:00
parent
8c3663ab0e
commit
1db349df18
@ -96,6 +96,7 @@ void LivestatusComponent::ClientThreadProc(const Socket::Ptr& client)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Query::Ptr query = boost::make_shared<Query>(lines);
|
Query::Ptr query = boost::make_shared<Query>(lines);
|
||||||
query->Execute(stream);
|
if (!query->Execute(stream))
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -302,7 +302,7 @@ void Query::PrintFixed16(const Stream::Ptr& stream, int code, const String& data
|
|||||||
stream->Write(header.CStr(), header.GetLength());
|
stream->Write(header.CStr(), header.GetLength());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Query::Execute(const Stream::Ptr& stream)
|
bool Query::Execute(const Stream::Ptr& stream)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
Log(LogInformation, "livestatus", "Executing livestatus query: " + m_Verb);
|
Log(LogInformation, "livestatus", "Executing livestatus query: " + m_Verb);
|
||||||
@ -319,6 +319,10 @@ void Query::Execute(const Stream::Ptr& stream)
|
|||||||
SendResponse(stream, 452, boost::diagnostic_information(ex));
|
SendResponse(stream, 452, boost::diagnostic_information(ex));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_KeepAlive)
|
if (!m_KeepAlive) {
|
||||||
stream->Close();
|
stream->Close();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ public:
|
|||||||
|
|
||||||
Query(const std::vector<String>& lines);
|
Query(const std::vector<String>& lines);
|
||||||
|
|
||||||
void Execute(const Stream::Ptr& stream);
|
bool Execute(const Stream::Ptr& stream);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
String m_Verb;
|
String m_Verb;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user