Module: check_mk
Branch: master
Commit: 4b127bbec45fa05bc811a2b54f42c9ae2a043455
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4b127bbec45fa0…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Aug 30 16:17:53 2018 +0200
Removed unused parameters.
Change-Id: I0b84755320b724ac60b68dbb68ed26989a64043e
---
livestatus/src/LogCache.cc | 3 +--
livestatus/src/LogCache.h | 3 +--
livestatus/src/Logfile.cc | 21 +++++++++------------
livestatus/src/Logfile.h | 9 ++++-----
livestatus/src/TableStateHistory.cc | 12 ++++++------
5 files changed, 21 insertions(+), 27 deletions(-)
diff --git a/livestatus/src/LogCache.cc b/livestatus/src/LogCache.cc
index 68d41fe..8a0ce98 100644
--- a/livestatus/src/LogCache.cc
+++ b/livestatus/src/LogCache.cc
@@ -119,8 +119,7 @@ void LogCache::scanLogfile(const fs::path &path, bool watch) {
The parameters to this method reflect the current query,
not the messages that just has been loaded.
*/
-void LogCache::handleNewMessage(Logfile *logfile, time_t /*unused*/,
- time_t /*unused*/, unsigned logclasses) {
+void LogCache::handleNewMessage(Logfile *logfile, unsigned logclasses) {
if (static_cast<unsigned long>(++num_cached_log_messages) <=
_max_cached_messages) {
return; // current message count still allowed, everything ok
diff --git a/livestatus/src/LogCache.h b/livestatus/src/LogCache.h
index 5044512..2031b63 100644
--- a/livestatus/src/LogCache.h
+++ b/livestatus/src/LogCache.h
@@ -46,8 +46,7 @@ public:
#ifdef CMC
void setMaxCachedMessages(unsigned long m);
#endif
- void handleNewMessage(Logfile *logfile, time_t since, time_t until,
- unsigned logclasses);
+ void handleNewMessage(Logfile *logfile, unsigned logclasses);
logfiles_t *logfiles() { return &_logfiles; };
void forgetLogfiles();
void updateLogfileIndex();
diff --git a/livestatus/src/Logfile.cc b/livestatus/src/Logfile.cc
index 584c8bb..dc162ec 100644
--- a/livestatus/src/Logfile.cc
+++ b/livestatus/src/Logfile.cc
@@ -83,8 +83,7 @@ void Logfile::flush() {
_logclasses_read = 0;
}
-void Logfile::load(LogCache *logcache, time_t since, time_t until,
- unsigned logclasses) {
+void Logfile::load(LogCache *logcache, unsigned logclasses) {
unsigned missing_types = logclasses & ~_logclasses_read;
FILE *file = nullptr;
// The current logfile has the _watch flag set to true.
@@ -107,14 +106,13 @@ void Logfile::load(LogCache *logcache, time_t since, time_t until,
// have read to the end of the file
if (_logclasses_read != 0u) {
fsetpos(file, &_read_pos); // continue at previous end
- loadRange(file, _logclasses_read, logcache, since, until,
- logclasses);
+ loadRange(file, _logclasses_read, logcache, logclasses);
fgetpos(file, &_read_pos);
}
if (missing_types != 0u) {
fseek(file, 0, SEEK_SET);
_lineno = 0;
- loadRange(file, missing_types, logcache, since, until, logclasses);
+ loadRange(file, missing_types, logcache, logclasses);
_logclasses_read |= missing_types;
fgetpos(file, &_read_pos); // remember current end of file
}
@@ -132,14 +130,14 @@ void Logfile::load(LogCache *logcache, time_t since, time_t until,
}
_lineno = 0;
- loadRange(file, missing_types, logcache, since, until, logclasses);
+ loadRange(file, missing_types, logcache, logclasses);
fclose(file);
_logclasses_read |= missing_types;
}
}
void Logfile::loadRange(FILE *file, unsigned missing_types, LogCache *logcache,
- time_t since, time_t until, unsigned logclasses) {
+ unsigned logclasses) {
std::vector<char> linebuffer(65536);
// TODO(sp) We should really use C++ I/O here...
while (fgets(&linebuffer[0], static_cast<int>(linebuffer.size()), file) !=
@@ -158,7 +156,7 @@ void Logfile::loadRange(FILE *file, unsigned missing_types, LogCache
*logcache,
}
}
if (processLogLine(_lineno, &linebuffer[0], missing_types)) {
- logcache->handleNewMessage(this, since, until, logclasses);
+ logcache->handleNewMessage(this, logclasses);
}
}
}
@@ -205,12 +203,11 @@ bool Logfile::processLogLine(size_t lineno, std::string line,
logfile_entries_t *Logfile::getEntriesFromQuery(const Query * /*unused*/,
LogCache *logcache,
- time_t since, time_t until,
unsigned logclasses) {
// Make sure existing references to objects point to correct world
updateReferences();
// make sure all messages are present
- load(logcache, since, until, logclasses);
+ load(logcache, logclasses);
return &_entries;
}
@@ -219,7 +216,7 @@ bool Logfile::answerQuery(Query *query, LogCache *logcache, time_t
since,
// Make sure existing references to objects point to correct world
updateReferences();
// make sure all messages are present
- load(logcache, since, until, logclasses);
+ load(logcache, logclasses);
uint64_t sincekey = makeKey(since, 0);
for (auto it = _entries.lower_bound(sincekey); it != _entries.end(); ++it) {
// end found or limit exceeded?
@@ -236,7 +233,7 @@ bool Logfile::answerQueryReverse(Query *query, LogCache *logcache,
time_t since,
// Make sure existing references to objects point to correct world
updateReferences();
// make sure all messages are present
- load(logcache, since, until, logclasses);
+ load(logcache, logclasses);
uint64_t untilkey = makeKey(until, 999999999);
auto it = _entries.upper_bound(untilkey);
while (it != _entries.begin()) {
diff --git a/livestatus/src/Logfile.h b/livestatus/src/Logfile.h
index 1877b93..05db416 100644
--- a/livestatus/src/Logfile.h
+++ b/livestatus/src/Logfile.h
@@ -70,15 +70,14 @@ public:
// character at both ends.
std::unique_ptr<std::vector<char>> readIntoBuffer();
#endif
- void load(LogCache *logcache, time_t since, time_t until,
- unsigned logclasses);
+ void load(LogCache *logcache, unsigned logclasses);
void flush();
time_t since() { return _since; }
unsigned classesRead() { return _logclasses_read; }
size_t size() { return _entries.size(); }
logfile_entries_t *getEntriesFromQuery(const Query *query,
- LogCache *logcache, time_t since,
- time_t until, unsigned logclasses);
+ LogCache *logcache,
+ unsigned logclasses);
bool answerQuery(Query *query, LogCache *logcache, time_t since,
time_t until, unsigned logclasses);
bool answerQueryReverse(Query *query, LogCache *logcache, time_t since,
@@ -91,7 +90,7 @@ public:
private:
void loadRange(FILE *file, unsigned missing_types, LogCache *logcache,
- time_t since, time_t until, unsigned logclasses);
+ unsigned logclasses);
bool processLogLine(size_t lineno, std::string line, unsigned logclasses);
uint64_t makeKey(time_t t, size_t lineno);
Logger *logger() const;
diff --git a/livestatus/src/TableStateHistory.cc b/livestatus/src/TableStateHistory.cc
index 53385bf..e0d6162 100644
--- a/livestatus/src/TableStateHistory.cc
+++ b/livestatus/src/TableStateHistory.cc
@@ -212,8 +212,8 @@ void TableStateHistory::getPreviousLogentry() {
return;
}
--_it_logs;
- _entries = _it_logs->second->getEntriesFromQuery(
- _query, _log_cache, _since, _until, classmask_statehist);
+ _entries = _it_logs->second->getEntriesFromQuery(_query, _log_cache,
+ classmask_statehist);
_it_entries = _entries->end();
}
--_it_entries;
@@ -230,8 +230,8 @@ LogEntry *TableStateHistory::getNextLogentry() {
return nullptr;
}
++_it_logs;
- _entries = _it_logs->second->getEntriesFromQuery(
- _query, _log_cache, _since, _until, classmask_statehist);
+ _entries = _it_logs->second->getEntriesFromQuery(_query, _log_cache,
+ classmask_statehist);
_it_entries = _entries->begin();
}
return _it_entries->second.get();
@@ -331,8 +331,8 @@ void TableStateHistory::answerQuery(Query *query) {
}
// Determine initial logentry
- _entries = _it_logs->second->getEntriesFromQuery(
- query, _log_cache, _since, _until, classmask_statehist);
+ _entries = _it_logs->second->getEntriesFromQuery(query, _log_cache,
+ classmask_statehist);
if (!_entries->empty() && _it_logs != newest_log) {
_it_entries = _entries->end();
// Check last entry. If it's younger than _since -> use this logfile too