Module: check_mk
Branch: master
Commit: 9dc4bb968063ce5d97d7b0f8103cfcca37b5c204
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9dc4bb968063ce…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Nov 2 16:58:20 2017 +0100
Always obey Query's request to stop producing rows.
Change-Id: I90688cad53b8e3de6e154a05841d79e417b5efee
---
livestatus/src/TableEventConsole.cc | 4 +++-
livestatus/src/TableHostsByGroup.cc | 2 +-
livestatus/src/TableServices.cc | 2 +-
livestatus/src/TableServicesByGroup.cc | 2 +-
livestatus/src/TableServicesByHostGroup.cc | 2 +-
5 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/livestatus/src/TableEventConsole.cc b/livestatus/src/TableEventConsole.cc
index a346c5c..107f31a 100644
--- a/livestatus/src/TableEventConsole.cc
+++ b/livestatus/src/TableEventConsole.cc
@@ -82,7 +82,9 @@ private:
row._host = it == row._map.end()
? nullptr
: _mc->getHostByDesignation(it->second);
- _query->processDataset(Row(&row));
+ if (!_query->processDataset(Row(&row))) {
+ return;
+ }
}
} while (true);
}
diff --git a/livestatus/src/TableHostsByGroup.cc b/livestatus/src/TableHostsByGroup.cc
index 82380c0..4dc19a2 100644
--- a/livestatus/src/TableHostsByGroup.cc
+++ b/livestatus/src/TableHostsByGroup.cc
@@ -64,7 +64,7 @@ void TableHostsByGroup::answerQuery(Query *query) {
for (hostsmember *m = hg->members; m != nullptr; m = m->next) {
hostbygroup hbg = {*m->host_ptr, hg};
if (!query->processDataset(Row(&hbg))) {
- break;
+ return;
}
}
}
diff --git a/livestatus/src/TableServices.cc b/livestatus/src/TableServices.cc
index 2c6c99b..8c167d5 100644
--- a/livestatus/src/TableServices.cc
+++ b/livestatus/src/TableServices.cc
@@ -494,7 +494,7 @@ void TableServices::answerQuery(Query *query) {
for (servicesmember *smem = m->host_ptr->services;
smem != nullptr; smem = smem->next) {
if (!query->processDataset(Row(smem->service_ptr))) {
- break;
+ return;
}
}
}
diff --git a/livestatus/src/TableServicesByGroup.cc
b/livestatus/src/TableServicesByGroup.cc
index 1306e74..0f61546 100644
--- a/livestatus/src/TableServicesByGroup.cc
+++ b/livestatus/src/TableServicesByGroup.cc
@@ -65,7 +65,7 @@ void TableServicesByGroup::answerQuery(Query *query) {
for (servicesmember *m = sg->members; m != nullptr; m = m->next) {
servicebygroup sbg = {*m->service_ptr, sg};
if (!query->processDataset(Row(&sbg))) {
- break;
+ return;
}
}
}
diff --git a/livestatus/src/TableServicesByHostGroup.cc
b/livestatus/src/TableServicesByHostGroup.cc
index 6d01daa..e4a5d27 100644
--- a/livestatus/src/TableServicesByHostGroup.cc
+++ b/livestatus/src/TableServicesByHostGroup.cc
@@ -59,7 +59,7 @@ void TableServicesByHostGroup::answerQuery(Query *query) {
smem != nullptr; smem = smem->next) {
servicebyhostgroup sbhg = {*smem->service_ptr, hg};
if (!query->processDataset(Row(&sbhg))) {
- break;
+ return;
}
}
}