mirror of https://github.com/Icinga/icinga2.git
parent
8c3663ab0e
commit
1db349df18
|
@ -96,6 +96,7 @@ void LivestatusComponent::ClientThreadProc(const Socket::Ptr& client)
|
|||
}
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
void Query::Execute(const Stream::Ptr& stream)
|
||||
bool Query::Execute(const Stream::Ptr& stream)
|
||||
{
|
||||
try {
|
||||
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));
|
||||
}
|
||||
|
||||
if (!m_KeepAlive)
|
||||
if (!m_KeepAlive) {
|
||||
stream->Close();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
|
||||
Query(const std::vector<String>& lines);
|
||||
|
||||
void Execute(const Stream::Ptr& stream);
|
||||
bool Execute(const Stream::Ptr& stream);
|
||||
|
||||
private:
|
||||
String m_Verb;
|
||||
|
|
Loading…
Reference in New Issue