mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-24 22:24:44 +02:00
parent
2036b87943
commit
f201886865
@ -244,10 +244,18 @@ static void CheckObjectFile(const String& objectfile, std::ostream& os)
|
|||||||
StdioStream::Ptr sfp = new StdioStream(&fp, false);
|
StdioStream::Ptr sfp = new StdioStream(&fp, false);
|
||||||
|
|
||||||
int typeL = 0, countTotal = 0;
|
int typeL = 0, countTotal = 0;
|
||||||
|
|
||||||
String message;
|
String message;
|
||||||
StreamReadContext src;
|
StreamReadContext src;
|
||||||
|
for (;;) {
|
||||||
|
StreamReadStatus srs = NetString::ReadStringFromStream(sfp, &message, src);
|
||||||
|
|
||||||
|
if (srs == StatusEof)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (srs != StatusNewItem)
|
||||||
|
continue;
|
||||||
|
|
||||||
while (NetString::ReadStringFromStream(sfp, &message, src) == StatusNewItem) {
|
|
||||||
Dictionary::Ptr object = JsonDecode(message);
|
Dictionary::Ptr object = JsonDecode(message);
|
||||||
Dictionary::Ptr properties = object->Get("properties");
|
Dictionary::Ptr properties = object->Get("properties");
|
||||||
|
|
||||||
|
@ -40,8 +40,15 @@ Value VariableUtility::GetVariable(const String& name)
|
|||||||
|
|
||||||
String message;
|
String message;
|
||||||
StreamReadContext src;
|
StreamReadContext src;
|
||||||
|
for (;;) {
|
||||||
|
StreamReadStatus srs = NetString::ReadStringFromStream(sfp, &message, src);
|
||||||
|
|
||||||
|
if (srs == StatusEof)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (srs != StatusNewItem)
|
||||||
|
continue;
|
||||||
|
|
||||||
while (NetString::ReadStringFromStream(sfp, &message, src) == StatusNewItem) {
|
|
||||||
Dictionary::Ptr variable = JsonDecode(message);
|
Dictionary::Ptr variable = JsonDecode(message);
|
||||||
|
|
||||||
if (variable->Get("name") == name) {
|
if (variable->Get("name") == name) {
|
||||||
@ -64,8 +71,15 @@ void VariableUtility::PrintVariables(std::ostream& outfp)
|
|||||||
|
|
||||||
String message;
|
String message;
|
||||||
StreamReadContext src;
|
StreamReadContext src;
|
||||||
|
for (;;) {
|
||||||
|
StreamReadStatus srs = NetString::ReadStringFromStream(sfp, &message, src);
|
||||||
|
|
||||||
|
if (srs == StatusEof)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (srs != StatusNewItem)
|
||||||
|
continue;
|
||||||
|
|
||||||
while (NetString::ReadStringFromStream(sfp, &message, src) == StatusNewItem) {
|
|
||||||
Dictionary::Ptr variable = JsonDecode(message);
|
Dictionary::Ptr variable = JsonDecode(message);
|
||||||
outfp << variable->Get("name") << " = " << variable->Get("value") << "\n";
|
outfp << variable->Get("name") << " = " << variable->Get("value") << "\n";
|
||||||
variables_count++;
|
variables_count++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user