diff --git a/icinga-app/icinga.cpp b/icinga-app/icinga.cpp index d4e27c566..e403d2dca 100644 --- a/icinga-app/icinga.cpp +++ b/icinga-app/icinga.cpp @@ -557,7 +557,7 @@ static int Main() int rc = 1; if (autocomplete) { - CLICommand::ShowCommands(argc, argv, &visibleDesc, &hiddenDesc, + CLICommand::ShowCommands(argc, argv, &visibleDesc, &GlobalArgumentCompletion, true, autoindex); rc = 0; } else if (command) { diff --git a/lib/base/process.cpp b/lib/base/process.cpp index aa6a0259e..8a51e475b 100644 --- a/lib/base/process.cpp +++ b/lib/base/process.cpp @@ -222,7 +222,7 @@ static Value ProcessSpawnImpl(struct msghdr *msgh, const Dictionary::Ptr& reques return response; } -static Value ProcessKillImpl(struct msghdr *msgh, const Dictionary::Ptr& request) +static Value ProcessKillImpl(const Dictionary::Ptr& request) { pid_t pid = request->Get("pid"); int signum = request->Get("signum"); @@ -238,7 +238,7 @@ static Value ProcessKillImpl(struct msghdr *msgh, const Dictionary::Ptr& request return response; } -static Value ProcessWaitPIDImpl(struct msghdr *msgh, const Dictionary::Ptr& request) +static Value ProcessWaitPIDImpl(const Dictionary::Ptr& request) { pid_t pid = request->Get("pid"); @@ -321,9 +321,9 @@ static void ProcessHandler() if (command == "spawn") response = ProcessSpawnImpl(&msg, request); else if (command == "waitpid") - response = ProcessWaitPIDImpl(&msg, request); + response = ProcessWaitPIDImpl(request); else if (command == "kill") - response = ProcessKillImpl(&msg, request); + response = ProcessKillImpl(request); else response = Empty; diff --git a/lib/cli/clicommand.cpp b/lib/cli/clicommand.cpp index cfdce0946..8987eef05 100644 --- a/lib/cli/clicommand.cpp +++ b/lib/cli/clicommand.cpp @@ -220,7 +220,6 @@ found_command: } void CLICommand::ShowCommands(int argc, char **argv, po::options_description *visibleDesc, - po::options_description *hiddenDesc, ArgumentCompletionCallback globalArgCompletionCallback, bool autocomplete, int autoindex) { diff --git a/lib/cli/clicommand.hpp b/lib/cli/clicommand.hpp index ce58b54b8..ef159599d 100644 --- a/lib/cli/clicommand.hpp +++ b/lib/cli/clicommand.hpp @@ -59,7 +59,6 @@ public: static void ShowCommands(int argc, char **argv, boost::program_options::options_description *visibleDesc = nullptr, - boost::program_options::options_description *hiddenDesc = nullptr, ArgumentCompletionCallback globalArgCompletionCallback = nullptr, bool autocomplete = false, int autoindex = -1); diff --git a/lib/cli/daemoncommand.cpp b/lib/cli/daemoncommand.cpp index 3a9ce8c0a..709b64f88 100644 --- a/lib/cli/daemoncommand.cpp +++ b/lib/cli/daemoncommand.cpp @@ -768,8 +768,10 @@ int DaemonCommand::Run(const po::variables_map& vm, const std::vector& ap) +int NodeSetupCommand::SetupMaster(const boost::program_options::variables_map& vm) { /* Ignore not required parameters */ if (vm.count("ticket")) @@ -250,7 +250,7 @@ int NodeSetupCommand::SetupMaster(const boost::program_options::variables_map& v return 0; } -int NodeSetupCommand::SetupNode(const boost::program_options::variables_map& vm, const std::vector& ap) +int NodeSetupCommand::SetupNode(const boost::program_options::variables_map& vm) { /* require at least one endpoint. Ticket is optional. */ if (!vm.count("endpoint")) { diff --git a/lib/cli/nodesetupcommand.hpp b/lib/cli/nodesetupcommand.hpp index d25d21e11..e5219f7b7 100644 --- a/lib/cli/nodesetupcommand.hpp +++ b/lib/cli/nodesetupcommand.hpp @@ -27,8 +27,8 @@ public: int Run(const boost::program_options::variables_map& vm, const std::vector& ap) const override; private: - static int SetupMaster(const boost::program_options::variables_map& vm, const std::vector& ap); - static int SetupNode(const boost::program_options::variables_map& vm, const std::vector& ap); + static int SetupMaster(const boost::program_options::variables_map& vm); + static int SetupNode(const boost::program_options::variables_map& vm); }; } diff --git a/lib/compat/compatlogger.cpp b/lib/compat/compatlogger.cpp index 60b47556e..23ac71427 100644 --- a/lib/compat/compatlogger.cpp +++ b/lib/compat/compatlogger.cpp @@ -52,10 +52,10 @@ void CompatLogger::Start(bool runtimeCreated) Checkable::OnNewCheckResult.connect([this](const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, const MessageOrigin::Ptr&) { CheckResultHandler(checkable, cr); }); - Checkable::OnNotificationSentToUser.connect([this](const Notification::Ptr& notification, const Checkable::Ptr& checkable, + Checkable::OnNotificationSentToUser.connect([this](const Notification::Ptr&, const Checkable::Ptr& checkable, const User::Ptr& user, const NotificationType& type, const CheckResult::Ptr& cr, const String& author, const String& commentText, const String& commandName, const MessageOrigin::Ptr&) { - NotificationSentHandler(notification, checkable, user, type, cr, author, commentText, commandName); + NotificationSentHandler(checkable, user, type, cr, author, commentText, commandName); }); Downtime::OnDowntimeTriggered.connect([this](const Downtime::Ptr& downtime) { TriggerDowntimeHandler(downtime); }); @@ -240,7 +240,7 @@ void CompatLogger::RemoveDowntimeHandler(const Downtime::Ptr& downtime) /** * @threadsafety Always. */ -void CompatLogger::NotificationSentHandler(const Notification::Ptr& notification, const Checkable::Ptr& checkable, +void CompatLogger::NotificationSentHandler(const Checkable::Ptr& checkable, const User::Ptr& user, NotificationType notification_type, CheckResult::Ptr const& cr, const String& author, const String& comment_text, const String& command_name) { diff --git a/lib/compat/compatlogger.hpp b/lib/compat/compatlogger.hpp index 9fb0b2978..af5314b95 100644 --- a/lib/compat/compatlogger.hpp +++ b/lib/compat/compatlogger.hpp @@ -35,7 +35,7 @@ private: void Flush(); void CheckResultHandler(const Checkable::Ptr& service, const CheckResult::Ptr& cr); - void NotificationSentHandler(const Notification::Ptr& notification, const Checkable::Ptr& service, + void NotificationSentHandler(const Checkable::Ptr& service, const User::Ptr& user, NotificationType notification_type, CheckResult::Ptr const& cr, const String& author, const String& comment_text, const String& command_name); void FlappingChangedHandler(const Checkable::Ptr& checkable); diff --git a/lib/config/expression.cpp b/lib/config/expression.cpp index 09b860cde..b6d1f2029 100644 --- a/lib/config/expression.cpp +++ b/lib/config/expression.cpp @@ -136,7 +136,7 @@ bool VariableExpression::GetReference(ScriptFrame& frame, bool init_dict, Value if (dhint && *dhint) *dhint = new DebugHint((*dhint)->GetChild(m_Variable)); - } else if (VMOps::FindVarImportRef(frame, m_Imports, m_Variable, parent, m_DebugInfo)) { + } else if (VMOps::FindVarImportRef(frame, m_Imports, m_Variable, parent)) { return true; } else if (ScriptGlobal::Exists(m_Variable)) { *parent = ScriptGlobal::GetGlobals(); @@ -470,7 +470,7 @@ ExpressionResult FunctionCallExpression::DoEvaluate(ScriptFrame& frame, DebugHin arguments.push_back(argres.GetValue()); } - return VMOps::ConstructorCall(vfunc, arguments, m_DebugInfo); + return VMOps::ConstructorCall(vfunc, arguments); } if (!vfunc.IsObjectType()) @@ -490,7 +490,7 @@ ExpressionResult FunctionCallExpression::DoEvaluate(ScriptFrame& frame, DebugHin arguments.push_back(argres.GetValue()); } - return VMOps::FunctionCall(frame, self, func, arguments); + return VMOps::FunctionCall(self, func, arguments); } ExpressionResult ArrayExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const diff --git a/lib/config/vmops.hpp b/lib/config/vmops.hpp index ea3098359..009c35cf9 100644 --- a/lib/config/vmops.hpp +++ b/lib/config/vmops.hpp @@ -26,7 +26,7 @@ namespace icinga class VMOps { public: - static inline bool FindVarImportRef(ScriptFrame& frame, const std::vector& imports, const String& name, Value *result, const DebugInfo& debugInfo = DebugInfo()) + static inline bool FindVarImportRef(ScriptFrame& frame, const std::vector& imports, const String& name, Value *result) { for (const auto& import : imports) { ExpressionResult res = import->Evaluate(frame); @@ -44,7 +44,7 @@ public: { Value parent; - if (FindVarImportRef(frame, imports, name, &parent, debugInfo)) { + if (FindVarImportRef(frame, imports, name, &parent)) { *result = GetField(parent, name, frame.Sandboxed, debugInfo); return true; } @@ -52,7 +52,7 @@ public: return false; } - static inline Value ConstructorCall(const Type::Ptr& type, const std::vector& args, const DebugInfo& debugInfo = DebugInfo()) + static inline Value ConstructorCall(const Type::Ptr& type, const std::vector& args) { if (type->GetName() == "String") { if (args.empty()) @@ -81,7 +81,7 @@ public: return type->Instantiate(args); } - static inline Value FunctionCall(ScriptFrame& frame, const Value& self, const Function::Ptr& func, const std::vector& arguments) + static inline Value FunctionCall(const Value& self, const Function::Ptr& func, const std::vector& arguments) { if (!self.IsEmpty() || self.IsString()) return func->InvokeThis(self, arguments); diff --git a/lib/db_ido/dbevents.cpp b/lib/db_ido/dbevents.cpp index cf80a0226..3c9f54914 100644 --- a/lib/db_ido/dbevents.cpp +++ b/lib/db_ido/dbevents.cpp @@ -64,9 +64,9 @@ void DbEvents::StaticInitialize() DbEvents::EnableFlappingChangedHandler(checkable); }); - Checkable::OnReachabilityChanged.connect([](const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, + Checkable::OnReachabilityChanged.connect([](const Checkable::Ptr&, const CheckResult::Ptr& cr, std::set children, const MessageOrigin::Ptr&) { - DbEvents::ReachabilityChangedHandler(checkable, cr, std::move(children)); + DbEvents::ReachabilityChangedHandler(cr, std::move(children)); }); /* History */ @@ -77,23 +77,23 @@ void DbEvents::StaticInitialize() DbEvents::AddAcknowledgementHistory(checkable, author, comment, type, notify, expiry); }); - Checkable::OnNotificationSentToAllUsers.connect([](const Notification::Ptr& notification, const Checkable::Ptr& checkable, - const std::set& users, const NotificationType& type, const CheckResult::Ptr& cr, const String& author, - const String& text, const MessageOrigin::Ptr&) { - DbEvents::AddNotificationHistory(notification, checkable, users, type, cr, author, text); + Checkable::OnNotificationSentToAllUsers.connect([](const Notification::Ptr&, const Checkable::Ptr& checkable, + const std::set& users, const NotificationType& type, const CheckResult::Ptr& cr, const String&, + const String&, const MessageOrigin::Ptr&) { + DbEvents::AddNotificationHistory(checkable, users, type, cr); }); - Checkable::OnStateChange.connect([](const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, StateType type, const MessageOrigin::Ptr&) { - DbEvents::AddStateChangeHistory(checkable, cr, type); + Checkable::OnStateChange.connect([](const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, StateType, const MessageOrigin::Ptr&) { + DbEvents::AddStateChangeHistory(checkable, cr); }); Checkable::OnNewCheckResult.connect([](const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, const MessageOrigin::Ptr&) { DbEvents::AddCheckResultLogHistory(checkable, cr); }); - Checkable::OnNotificationSentToUser.connect([](const Notification::Ptr& notification, const Checkable::Ptr& checkable, + Checkable::OnNotificationSentToUser.connect([](const Notification::Ptr&, const Checkable::Ptr& checkable, const User::Ptr& users, const NotificationType& type, const CheckResult::Ptr& cr, const String& author, const String& text, const String&, const MessageOrigin::Ptr&) { - DbEvents::AddNotificationSentLogHistory(notification, checkable, users, type, cr, author, text); + DbEvents::AddNotificationSentLogHistory(checkable, users, type, cr, author, text); }); Checkable::OnFlappingChanged.connect([](const Checkable::Ptr& checkable, const Value&) { DbEvents::AddFlappingChangedLogHistory(checkable); @@ -219,7 +219,7 @@ void DbEvents::LastNotificationChangedHandler(const Notification::Ptr& notificat DbObject::OnQuery(query1); } -void DbEvents::ReachabilityChangedHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, std::set children) +void DbEvents::ReachabilityChangedHandler(const CheckResult::Ptr& cr, std::set children) { int is_reachable = 0; @@ -834,8 +834,8 @@ void DbEvents::AddAcknowledgementInternal(const Checkable::Ptr& checkable, Ackno } /* notifications */ -void DbEvents::AddNotificationHistory(const Notification::Ptr& notification, const Checkable::Ptr& checkable, const std::set& users, NotificationType type, - const CheckResult::Ptr& cr, const String& author, const String& text) +void DbEvents::AddNotificationHistory(const Checkable::Ptr& checkable, const std::set& users, NotificationType type, + const CheckResult::Ptr& cr) { /* NotificationInsertID has to be tracked per IDO instance, therefore the OnQuery and OnMultipleQueries signals * cannot be called directly as all IDO instances would insert rows with the same ID which is (most likely) only @@ -913,7 +913,7 @@ void DbEvents::AddNotificationHistory(const Notification::Ptr& notification, con } /* statehistory */ -void DbEvents::AddStateChangeHistory(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, StateType type) +void DbEvents::AddStateChangeHistory(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr) { double ts = cr->GetExecutionEnd(); std::pair timeBag = ConvertTimestamp(ts); @@ -1113,7 +1113,7 @@ void DbEvents::AddRemoveDowntimeLogHistory(const Downtime::Ptr& downtime) AddLogHistory(checkable, msgbuf.str(), LogEntryTypeInfoMessage); } -void DbEvents::AddNotificationSentLogHistory(const Notification::Ptr& notification, const Checkable::Ptr& checkable, const User::Ptr& user, +void DbEvents::AddNotificationSentLogHistory(const Checkable::Ptr& checkable, const User::Ptr& user, NotificationType notification_type, const CheckResult::Ptr& cr, const String& author, const String& comment_text) { diff --git a/lib/db_ido/dbevents.hpp b/lib/db_ido/dbevents.hpp index 858f3b3da..8ca5411dd 100644 --- a/lib/db_ido/dbevents.hpp +++ b/lib/db_ido/dbevents.hpp @@ -73,7 +73,7 @@ public: static void RemoveAcknowledgement(const Checkable::Ptr& checkable); static void AddAcknowledgementInternal(const Checkable::Ptr& checkable, AcknowledgementType type, bool add); - static void ReachabilityChangedHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, std::set children); + static void ReachabilityChangedHandler(const CheckResult::Ptr& cr, std::set children); /* comment, downtime, acknowledgement history */ static void AddCommentHistory(const Comment::Ptr& comment); @@ -82,18 +82,17 @@ public: AcknowledgementType type, bool notify, double expiry); /* notification & contactnotification history */ - static void AddNotificationHistory(const Notification::Ptr& notification, const Checkable::Ptr& checkable, - const std::set& users, NotificationType type, const CheckResult::Ptr& cr, const String& author, - const String& text); + static void AddNotificationHistory(const Checkable::Ptr& checkable, + const std::set& users, NotificationType type, const CheckResult::Ptr& cr); /* statehistory */ - static void AddStateChangeHistory(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, StateType type); + static void AddStateChangeHistory(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr); /* logentries */ static void AddCheckResultLogHistory(const Checkable::Ptr& checkable, const CheckResult::Ptr &cr); static void AddTriggerDowntimeLogHistory(const Downtime::Ptr& downtime); static void AddRemoveDowntimeLogHistory(const Downtime::Ptr& downtime); - static void AddNotificationSentLogHistory(const Notification::Ptr& notification, const Checkable::Ptr& checkable, + static void AddNotificationSentLogHistory(const Checkable::Ptr& checkable, const User::Ptr& user, NotificationType notification_type, const CheckResult::Ptr& cr, const String& author, const String& comment_text); diff --git a/lib/icinga/comment.cpp b/lib/icinga/comment.cpp index 9664f9bdf..59373ac09 100644 --- a/lib/icinga/comment.cpp +++ b/lib/icinga/comment.cpp @@ -80,7 +80,7 @@ void Comment::Start(bool runtimeCreated) static boost::once_flag once = BOOST_ONCE_INIT; - boost::call_once(once, [this]() { + boost::call_once(once, [] { l_CommentsExpireTimer = Timer::Create(); l_CommentsExpireTimer->SetInterval(60); l_CommentsExpireTimer->OnTimerExpired.connect([](const Timer * const&) { CommentsExpireTimerHandler(); }); @@ -131,7 +131,7 @@ int Comment::GetNextCommentID() } Comment::Ptr Comment::AddComment(const Checkable::Ptr& checkable, CommentType entryType, const String& author, - const String& text, bool persistent, double expireTime, bool sticky, const String& id, const MessageOrigin::Ptr& origin) + const String& text, bool persistent, double expireTime, bool sticky, const String& id) { String fullName; @@ -187,8 +187,7 @@ Comment::Ptr Comment::AddComment(const Checkable::Ptr& checkable, CommentType en return comment; } -void Comment::RemoveComment(const String& id, bool removedManually, const String& removedBy, - const MessageOrigin::Ptr& origin) +void Comment::RemoveComment(const String& id, bool removedManually, const String& removedBy) { Comment::Ptr comment = Comment::GetByName(id); diff --git a/lib/icinga/comment.hpp b/lib/icinga/comment.hpp index a230040f8..ab20474e9 100644 --- a/lib/icinga/comment.hpp +++ b/lib/icinga/comment.hpp @@ -36,10 +36,9 @@ public: static Ptr AddComment(const intrusive_ptr& checkable, CommentType entryType, const String& author, const String& text, bool persistent, double expireTime, bool sticky = false, - const String& id = String(), const MessageOrigin::Ptr& origin = nullptr); + const String& id = String()); - static void RemoveComment(const String& id, bool removedManually = false, const String& removedBy = "", - const MessageOrigin::Ptr& origin = nullptr); + static void RemoveComment(const String& id, bool removedManually = false, const String& removedBy = ""); static String GetCommentIDFromLegacyID(int id); diff --git a/lib/icinga/downtime.cpp b/lib/icinga/downtime.cpp index 66462cef6..b1f1db326 100644 --- a/lib/icinga/downtime.cpp +++ b/lib/icinga/downtime.cpp @@ -93,7 +93,7 @@ void Downtime::Start(bool runtimeCreated) static boost::once_flag once = BOOST_ONCE_INIT; - boost::call_once(once, [this]() { + boost::call_once(once, [] { l_DowntimesStartTimer = Timer::Create(); l_DowntimesStartTimer->SetInterval(5); l_DowntimesStartTimer->OnTimerExpired.connect([](const Timer * const&){ DowntimesStartTimerHandler(); }); @@ -360,7 +360,7 @@ Downtime::Ptr Downtime::AddDowntime(const Checkable::Ptr& checkable, const Strin } void Downtime::RemoveDowntime(const String& id, bool includeChildren, DowntimeRemovalReason removalReason, - const String& removedBy, const MessageOrigin::Ptr& origin) + const String& removedBy) { Downtime::Ptr downtime = Downtime::GetByName(id); diff --git a/lib/icinga/downtime.hpp b/lib/icinga/downtime.hpp index 8be69826f..89f52ffbe 100644 --- a/lib/icinga/downtime.hpp +++ b/lib/icinga/downtime.hpp @@ -60,7 +60,7 @@ public: const MessageOrigin::Ptr& origin = nullptr); static void RemoveDowntime(const String& id, bool includeChildren, DowntimeRemovalReason removalReason, - const String& removedBy = "", const MessageOrigin::Ptr& origin = nullptr); + const String& removedBy = ""); void RegisterChild(const Downtime::Ptr& downtime); void UnregisterChild(const Downtime::Ptr& downtime); diff --git a/lib/icinga/macroprocessor.cpp b/lib/icinga/macroprocessor.cpp index 724a4f965..f87d5257a 100644 --- a/lib/icinga/macroprocessor.cpp +++ b/lib/icinga/macroprocessor.cpp @@ -67,7 +67,7 @@ Value MacroProcessor::ResolveMacros(const Value& str, const ResolverList& resolv result = resultDict; } else if (str.IsObjectType()) { - result = EvaluateFunction(str, resolvers, cr, escapeFn, resolvedMacros, useResolvedMacros, 0); + result = EvaluateFunction(str, resolvers, cr, resolvedMacros, useResolvedMacros, 0); } else { BOOST_THROW_EXCEPTION(std::invalid_argument("Macro is not a string or array.")); } @@ -192,7 +192,7 @@ bool MacroProcessor::ResolveMacro(const String& macro, const ResolverList& resol } Value MacroProcessor::EvaluateFunction(const Function::Ptr& func, const ResolverList& resolvers, - const CheckResult::Ptr& cr, const MacroProcessor::EscapeCallback& escapeFn, + const CheckResult::Ptr& cr, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros, int recursionLevel) { Dictionary::Ptr resolvers_this = new Dictionary(); @@ -273,7 +273,7 @@ Value MacroProcessor::InternalResolveMacros(const String& str, const ResolverLis } if (resolved_macro.IsObjectType()) { - resolved_macro = EvaluateFunction(resolved_macro, resolvers, cr, escapeFn, + resolved_macro = EvaluateFunction(resolved_macro, resolvers, cr, resolvedMacros, useResolvedMacros, recursionLevel + 1); } diff --git a/lib/icinga/macroprocessor.hpp b/lib/icinga/macroprocessor.hpp index 7e7482153..97b7d123f 100644 --- a/lib/icinga/macroprocessor.hpp +++ b/lib/icinga/macroprocessor.hpp @@ -61,7 +61,7 @@ private: const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros, int recursionLevel = 0); static Value EvaluateFunction(const Function::Ptr& func, const ResolverList& resolvers, - const CheckResult::Ptr& cr, const MacroProcessor::EscapeCallback& escapeFn, + const CheckResult::Ptr& cr, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros, int recursionLevel); static void AddArgumentHelper(const Array::Ptr& args, const String& key, const String& value, diff --git a/lib/icinga/notification.cpp b/lib/icinga/notification.cpp index 9bb0d05fa..234155bcd 100644 --- a/lib/icinga/notification.cpp +++ b/lib/icinga/notification.cpp @@ -494,8 +494,8 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe // Explicitly use Notification::Ptr to keep the reference counted while the callback is active Notification::Ptr notification (this); - Utility::QueueAsyncCallback([notification, type, user, cr, force, author, text]() { - notification->ExecuteNotificationHelper(type, user, cr, force, author, text); + Utility::QueueAsyncCallback([notification, type, user, cr, author, text]() { + notification->ExecuteNotificationHelper(type, user, cr, author, text); }); /* collect all notified users */ @@ -600,7 +600,7 @@ bool Notification::CheckNotificationUserFilters(NotificationType type, const Use return true; } -void Notification::ExecuteNotificationHelper(NotificationType type, const User::Ptr& user, const CheckResult::Ptr& cr, bool force, const String& author, const String& text) +void Notification::ExecuteNotificationHelper(NotificationType type, const User::Ptr& user, const CheckResult::Ptr& cr, const String& author, const String& text) { String notificationName = GetName(); String userName = user->GetName(); diff --git a/lib/icinga/notification.hpp b/lib/icinga/notification.hpp index 0e2f50c4c..c1190bb0d 100644 --- a/lib/icinga/notification.hpp +++ b/lib/icinga/notification.hpp @@ -142,7 +142,7 @@ private: bool CheckNotificationUserFilters(NotificationType type, const User::Ptr& user, bool force, bool reminder); - void ExecuteNotificationHelper(NotificationType type, const User::Ptr& user, const CheckResult::Ptr& cr, bool force, const String& author = "", const String& text = ""); + void ExecuteNotificationHelper(NotificationType type, const User::Ptr& user, const CheckResult::Ptr& cr, const String& author = "", const String& text = ""); static bool EvaluateApplyRuleInstance(const intrusive_ptr& checkable, const String& name, ScriptFrame& frame, const ApplyRule& rule, bool skipFilter); static bool EvaluateApplyRule(const intrusive_ptr& checkable, const ApplyRule& rule, bool skipFilter = false); diff --git a/lib/icinga/pluginutility.cpp b/lib/icinga/pluginutility.cpp index 4dc46f754..354915d65 100644 --- a/lib/icinga/pluginutility.cpp +++ b/lib/icinga/pluginutility.cpp @@ -13,7 +13,7 @@ using namespace icinga; -void PluginUtility::ExecuteCommand(const Command::Ptr& commandObj, const Checkable::Ptr& checkable, +void PluginUtility::ExecuteCommand(const Command::Ptr& commandObj, const CheckResult::Ptr& cr, const MacroProcessor::ResolverList& macroResolvers, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros, int timeout, const std::function& callback) diff --git a/lib/icinga/pluginutility.hpp b/lib/icinga/pluginutility.hpp index 3f6a8444a..c757801da 100644 --- a/lib/icinga/pluginutility.hpp +++ b/lib/icinga/pluginutility.hpp @@ -22,7 +22,7 @@ struct ProcessResult; class PluginUtility { public: - static void ExecuteCommand(const Command::Ptr& commandObj, const Checkable::Ptr& checkable, + static void ExecuteCommand(const Command::Ptr& commandObj, const CheckResult::Ptr& cr, const MacroProcessor::ResolverList& macroResolvers, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros, int timeout, const std::function& callback = std::function()); diff --git a/lib/icinga/scheduleddowntime.cpp b/lib/icinga/scheduleddowntime.cpp index f9ddc4385..3447b2a19 100644 --- a/lib/icinga/scheduleddowntime.cpp +++ b/lib/icinga/scheduleddowntime.cpp @@ -77,7 +77,7 @@ void ScheduledDowntime::Start(bool runtimeCreated) static boost::once_flag once = BOOST_ONCE_INIT; - boost::call_once(once, [this]() { + boost::call_once(once, [] { l_Timer = Timer::Create(); l_Timer->SetInterval(60); l_Timer->OnTimerExpired.connect([](const Timer * const&) { TimerProc(); }); diff --git a/lib/icinga/timeperiod.cpp b/lib/icinga/timeperiod.cpp index d5188a68b..e49f89f47 100644 --- a/lib/icinga/timeperiod.cpp +++ b/lib/icinga/timeperiod.cpp @@ -23,7 +23,7 @@ void TimePeriod::Start(bool runtimeCreated) static boost::once_flag once = BOOST_ONCE_INIT; - boost::call_once(once, [this]() { + boost::call_once(once, [] { l_UpdateTimer = Timer::Create(); l_UpdateTimer->SetInterval(300); l_UpdateTimer->OnTimerExpired.connect([](const Timer * const&) { UpdateTimerHandler(); }); diff --git a/lib/icingadb/icingadb-objects.cpp b/lib/icingadb/icingadb-objects.cpp index a8c2ed0b2..2e7bc36c5 100644 --- a/lib/icingadb/icingadb-objects.cpp +++ b/lib/icingadb/icingadb-objects.cpp @@ -1494,7 +1494,7 @@ void IcingaDB::AddObjectDataToRuntimeUpdates(std::vector& runti // Takes object and collects IcingaDB relevant attributes and computes checksums. Returns whether the object is relevant // for IcingaDB. -bool IcingaDB::PrepareObject(const ConfigObject::Ptr& object, Dictionary::Ptr& attributes, Dictionary::Ptr& checksums) +bool IcingaDB::PrepareObject(const ConfigObject::Ptr& object, Dictionary::Ptr& attributes) { auto originalAttrs (object->GetOriginalAttributes()); @@ -1818,9 +1818,8 @@ IcingaDB::CreateConfigUpdate(const ConfigObject::Ptr& object, const String typeN return; Dictionary::Ptr attr = new Dictionary; - Dictionary::Ptr chksm = new Dictionary; - if (!PrepareObject(object, attr, chksm)) + if (!PrepareObject(object, attr)) return; InsertObjectDependencies(object, typeName, hMSets, runtimeUpdates, runtimeUpdate); diff --git a/lib/icingadb/icingadb.hpp b/lib/icingadb/icingadb.hpp index 33b6414c8..01fa6bbd6 100644 --- a/lib/icingadb/icingadb.hpp +++ b/lib/icingadb/icingadb.hpp @@ -185,7 +185,7 @@ private: static String HashValue(const Value& value, const std::set& propertiesBlacklist, bool propertiesWhitelist = false); static String GetLowerCaseTypeNameDB(const ConfigObject::Ptr& obj); - static bool PrepareObject(const ConfigObject::Ptr& object, Dictionary::Ptr& attributes, Dictionary::Ptr& checkSums); + static bool PrepareObject(const ConfigObject::Ptr& object, Dictionary::Ptr& attributes); static void ReachabilityChangeHandler(const std::set& children); static void StateChangeHandler(const ConfigObject::Ptr& object, const CheckResult::Ptr& cr, StateType type); diff --git a/lib/livestatus/historytable.hpp b/lib/livestatus/historytable.hpp index f1178573a..3c95715b1 100644 --- a/lib/livestatus/historytable.hpp +++ b/lib/livestatus/historytable.hpp @@ -16,7 +16,7 @@ namespace icinga class HistoryTable : public Table { public: - virtual void UpdateLogEntries(const Dictionary::Ptr& bag, int line_count, int lineno, const AddRowFunction& addRowFn) = 0; + virtual void UpdateLogEntries(const Dictionary::Ptr& bag, int lineno, const AddRowFunction& addRowFn) = 0; }; } diff --git a/lib/livestatus/hoststable.cpp b/lib/livestatus/hoststable.cpp index d90f4a56e..412d4d9c6 100644 --- a/lib/livestatus/hoststable.cpp +++ b/lib/livestatus/hoststable.cpp @@ -152,8 +152,8 @@ void HostsTable::AddColumns(Table *table, const String& prefix, /* _1 = row, _2 = groupByType, _3 = groupByObject */ Log(LogDebug, "Livestatus") << "Processing hosts group by hostgroup table."; - HostGroupsTable::AddColumns(table, "hostgroup_", [](const Value& row, LivestatusGroupByType groupByType, const Object::Ptr& groupByObject) -> Value { - return HostGroupAccessor(row, groupByType, groupByObject); + HostGroupsTable::AddColumns(table, "hostgroup_", [](const Value&, LivestatusGroupByType groupByType, const Object::Ptr& groupByObject) -> Value { + return HostGroupAccessor(groupByType, groupByObject); }); } } @@ -186,7 +186,7 @@ void HostsTable::FetchRows(const AddRowFunction& addRowFn) } } -Object::Ptr HostsTable::HostGroupAccessor(const Value& row, LivestatusGroupByType groupByType, const Object::Ptr& groupByObject) +Object::Ptr HostsTable::HostGroupAccessor(LivestatusGroupByType groupByType, const Object::Ptr& groupByObject) { /* return the current group by value set from within FetchRows() * this is the hostgrouo object used for the table join inside diff --git a/lib/livestatus/hoststable.hpp b/lib/livestatus/hoststable.hpp index 9386183ce..5267dfa96 100644 --- a/lib/livestatus/hoststable.hpp +++ b/lib/livestatus/hoststable.hpp @@ -29,7 +29,7 @@ public: protected: void FetchRows(const AddRowFunction& addRowFn) override; - static Object::Ptr HostGroupAccessor(const Value& row, LivestatusGroupByType groupByType, const Object::Ptr& groupByObject); + static Object::Ptr HostGroupAccessor(LivestatusGroupByType groupByType, const Object::Ptr& groupByObject); static Value NameAccessor(const Value& row); static Value DisplayNameAccessor(const Value& row); diff --git a/lib/livestatus/livestatuslogutility.cpp b/lib/livestatus/livestatuslogutility.cpp index 565c2ca8e..c9c9f8868 100644 --- a/lib/livestatus/livestatuslogutility.cpp +++ b/lib/livestatus/livestatuslogutility.cpp @@ -59,7 +59,6 @@ void LivestatusLogUtility::CreateLogCache(std::map index, Histor ASSERT(table); /* m_LogFileIndex map tells which log files are involved ordered by their start timestamp */ - unsigned long line_count = 0; for (const auto& kv : index) { unsigned int ts = kv.first; @@ -90,9 +89,8 @@ void LivestatusLogUtility::CreateLogCache(std::map index, Histor continue; } - table->UpdateLogEntries(log_entry_attrs, line_count, lineno, addRowFn); + table->UpdateLogEntries(log_entry_attrs, lineno, addRowFn); - line_count++; lineno++; } diff --git a/lib/livestatus/logtable.cpp b/lib/livestatus/logtable.cpp index c1358dde0..c75b46276 100644 --- a/lib/livestatus/logtable.cpp +++ b/lib/livestatus/logtable.cpp @@ -92,7 +92,7 @@ void LogTable::FetchRows(const AddRowFunction& addRowFn) } /* gets called in LivestatusLogUtility::CreateLogCache */ -void LogTable::UpdateLogEntries(const Dictionary::Ptr& log_entry_attrs, int line_count, int lineno, const AddRowFunction& addRowFn) +void LogTable::UpdateLogEntries(const Dictionary::Ptr& log_entry_attrs, int lineno, const AddRowFunction& addRowFn) { /* additional attributes only for log table */ log_entry_attrs->Set("lineno", lineno); diff --git a/lib/livestatus/logtable.hpp b/lib/livestatus/logtable.hpp index 7a8931004..8a1cb3afa 100644 --- a/lib/livestatus/logtable.hpp +++ b/lib/livestatus/logtable.hpp @@ -26,7 +26,7 @@ public: String GetName() const override; String GetPrefix() const override; - void UpdateLogEntries(const Dictionary::Ptr& log_entry_attrs, int line_count, int lineno, const AddRowFunction& addRowFn) override; + void UpdateLogEntries(const Dictionary::Ptr& log_entry_attrs, int lineno, const AddRowFunction& addRowFn) override; protected: void FetchRows(const AddRowFunction& addRowFn) override; diff --git a/lib/livestatus/servicestable.cpp b/lib/livestatus/servicestable.cpp index 681445aaf..cf1fcd122 100644 --- a/lib/livestatus/servicestable.cpp +++ b/lib/livestatus/servicestable.cpp @@ -129,15 +129,15 @@ void ServicesTable::AddColumns(Table *table, const String& prefix, /* _1 = row, _2 = groupByType, _3 = groupByObject */ Log(LogDebug, "Livestatus") << "Processing services group by servicegroup table."; - ServiceGroupsTable::AddColumns(table, "servicegroup_", [](const Value& row, LivestatusGroupByType groupByType, const Object::Ptr& groupByObject) -> Value { - return ServiceGroupAccessor(row, groupByType, groupByObject); + ServiceGroupsTable::AddColumns(table, "servicegroup_", [](const Value&, LivestatusGroupByType groupByType, const Object::Ptr& groupByObject) -> Value { + return ServiceGroupAccessor(groupByType, groupByObject); }); } else if (table->GetGroupByType() == LivestatusGroupByHostGroup) { /* _1 = row, _2 = groupByType, _3 = groupByObject */ Log(LogDebug, "Livestatus") << "Processing services group by hostgroup table."; - HostGroupsTable::AddColumns(table, "hostgroup_", [](const Value& row, LivestatusGroupByType groupByType, const Object::Ptr& groupByObject) -> Value { - return HostGroupAccessor(row, groupByType, groupByObject); + HostGroupsTable::AddColumns(table, "hostgroup_", [](const Value&, LivestatusGroupByType groupByType, const Object::Ptr& groupByObject) -> Value { + return HostGroupAccessor(groupByType, groupByObject); }); } } @@ -199,7 +199,7 @@ Object::Ptr ServicesTable::HostAccessor(const Value& row, const Column::ObjectAc return svc->GetHost(); } -Object::Ptr ServicesTable::ServiceGroupAccessor(const Value& row, LivestatusGroupByType groupByType, const Object::Ptr& groupByObject) +Object::Ptr ServicesTable::ServiceGroupAccessor(LivestatusGroupByType groupByType, const Object::Ptr& groupByObject) { /* return the current group by value set from within FetchRows() * this is the servicegroup object used for the table join inside @@ -211,7 +211,7 @@ Object::Ptr ServicesTable::ServiceGroupAccessor(const Value& row, LivestatusGrou return nullptr; } -Object::Ptr ServicesTable::HostGroupAccessor(const Value& row, LivestatusGroupByType groupByType, const Object::Ptr& groupByObject) +Object::Ptr ServicesTable::HostGroupAccessor(LivestatusGroupByType groupByType, const Object::Ptr& groupByObject) { /* return the current group by value set from within FetchRows() * this is the servicegroup object used for the table join inside diff --git a/lib/livestatus/servicestable.hpp b/lib/livestatus/servicestable.hpp index 56d5ae541..94ef0c311 100644 --- a/lib/livestatus/servicestable.hpp +++ b/lib/livestatus/servicestable.hpp @@ -30,8 +30,8 @@ protected: void FetchRows(const AddRowFunction& addRowFn) override; static Object::Ptr HostAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor); - static Object::Ptr ServiceGroupAccessor(const Value& row, LivestatusGroupByType groupByType, const Object::Ptr& groupByObject); - static Object::Ptr HostGroupAccessor(const Value& row, LivestatusGroupByType groupByType, const Object::Ptr& groupByObject); + static Object::Ptr ServiceGroupAccessor(LivestatusGroupByType groupByType, const Object::Ptr& groupByObject); + static Object::Ptr HostGroupAccessor(LivestatusGroupByType groupByType, const Object::Ptr& groupByObject); static Value ShortNameAccessor(const Value& row); static Value DisplayNameAccessor(const Value& row); diff --git a/lib/livestatus/statehisttable.cpp b/lib/livestatus/statehisttable.cpp index 46a6675bb..0f544d4f9 100644 --- a/lib/livestatus/statehisttable.cpp +++ b/lib/livestatus/statehisttable.cpp @@ -36,7 +36,7 @@ StateHistTable::StateHistTable(const String& compat_log_path, time_t from, time_ AddColumns(this); } -void StateHistTable::UpdateLogEntries(const Dictionary::Ptr& log_entry_attrs, int line_count, int lineno, const AddRowFunction& addRowFn) +void StateHistTable::UpdateLogEntries(const Dictionary::Ptr& log_entry_attrs, int lineno, const AddRowFunction&) { unsigned int time = log_entry_attrs->Get("time"); String host_name = log_entry_attrs->Get("host_name"); diff --git a/lib/livestatus/statehisttable.hpp b/lib/livestatus/statehisttable.hpp index db0061575..ac4ff5a82 100644 --- a/lib/livestatus/statehisttable.hpp +++ b/lib/livestatus/statehisttable.hpp @@ -27,7 +27,7 @@ public: String GetName() const override; String GetPrefix() const override; - void UpdateLogEntries(const Dictionary::Ptr& log_entry_attrs, int line_count, int lineno, const AddRowFunction& addRowFn) override; + void UpdateLogEntries(const Dictionary::Ptr& log_entry_attrs, int lineno, const AddRowFunction& addRowFn) override; protected: void FetchRows(const AddRowFunction& addRowFn) override; diff --git a/lib/methods/pluginchecktask.cpp b/lib/methods/pluginchecktask.cpp index f5600bd14..4cc961fe1 100644 --- a/lib/methods/pluginchecktask.cpp +++ b/lib/methods/pluginchecktask.cpp @@ -53,7 +53,7 @@ void PluginCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckRes }; } - PluginUtility::ExecuteCommand(commandObj, checkable, checkable->GetLastCheckResult(), + PluginUtility::ExecuteCommand(commandObj, checkable->GetLastCheckResult(), resolvers, resolvedMacros, useResolvedMacros, timeout, callback); if (!resolvedMacros || useResolvedMacros) { diff --git a/lib/methods/plugineventtask.cpp b/lib/methods/plugineventtask.cpp index 00efb6ce4..4172e3031 100644 --- a/lib/methods/plugineventtask.cpp +++ b/lib/methods/plugineventtask.cpp @@ -45,7 +45,7 @@ void PluginEventTask::ScriptFunc(const Checkable::Ptr& checkable, callback = [checkable](const Value& commandLine, const ProcessResult& pr) { ProcessFinishedHandler(checkable, commandLine, pr); }; } - PluginUtility::ExecuteCommand(commandObj, checkable, checkable->GetLastCheckResult(), + PluginUtility::ExecuteCommand(commandObj, checkable->GetLastCheckResult(), resolvers, resolvedMacros, useResolvedMacros, timeout, callback); } diff --git a/lib/methods/pluginnotificationtask.cpp b/lib/methods/pluginnotificationtask.cpp index 95911fae9..4b2e64a90 100644 --- a/lib/methods/pluginnotificationtask.cpp +++ b/lib/methods/pluginnotificationtask.cpp @@ -107,7 +107,7 @@ void PluginNotificationTask::ScriptFunc(const Notification::Ptr& notification, callback = [checkable](const Value& commandline, const ProcessResult& pr) { ProcessFinishedHandler(checkable, commandline, pr); }; } - PluginUtility::ExecuteCommand(commandObj, checkable, cr, resolvers, + PluginUtility::ExecuteCommand(commandObj, cr, resolvers, resolvedMacros, useResolvedMacros, timeout, callback); } diff --git a/lib/perfdata/opentsdbwriter.cpp b/lib/perfdata/opentsdbwriter.cpp index 1ebc139f4..4ce1a89a6 100644 --- a/lib/perfdata/opentsdbwriter.cpp +++ b/lib/perfdata/opentsdbwriter.cpp @@ -73,7 +73,7 @@ void OpenTsdbWriter::Resume() Log(LogInformation, "OpentsdbWriter") << "'" << GetName() << "' resumed."; - ReadConfigTemplate(m_ServiceConfigTemplate, m_HostConfigTemplate); + ReadConfigTemplate(); m_ReconnectTimer = Timer::Create(); m_ReconnectTimer->SetInterval(10); @@ -455,8 +455,7 @@ String OpenTsdbWriter::EscapeMetric(const String& str) * @param stemplate The dictionary to save the service configuration to * @param htemplate The dictionary to save the host configuration to */ -void OpenTsdbWriter::ReadConfigTemplate(const Dictionary::Ptr& stemplate, - const Dictionary::Ptr& htemplate) +void OpenTsdbWriter::ReadConfigTemplate() { m_ServiceConfigTemplate = GetServiceTemplate(); diff --git a/lib/perfdata/opentsdbwriter.hpp b/lib/perfdata/opentsdbwriter.hpp index e37ef4257..de888e5da 100644 --- a/lib/perfdata/opentsdbwriter.hpp +++ b/lib/perfdata/opentsdbwriter.hpp @@ -53,8 +53,7 @@ private: void ReconnectTimerHandler(); - void ReadConfigTemplate(const Dictionary::Ptr& stemplate, - const Dictionary::Ptr& htemplate); + void ReadConfigTemplate(); }; } diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp index 547eadc7f..deedd4143 100644 --- a/lib/remote/apilistener.cpp +++ b/lib/remote/apilistener.cpp @@ -255,7 +255,7 @@ void ApiListener::Start(bool runtimeCreated) RenewCA(); }); } else { - m_RenewOwnCertTimer->OnTimerExpired.connect([this](const Timer * const&) { + m_RenewOwnCertTimer->OnTimerExpired.connect([](const Timer * const&) { JsonRpcConnection::SendCertificateRequest(nullptr, nullptr, String()); }); } diff --git a/lib/remote/apilistener.ti b/lib/remote/apilistener.ti index 8317abc4b..55ec749c5 100644 --- a/lib/remote/apilistener.ti +++ b/lib/remote/apilistener.ti @@ -38,7 +38,7 @@ class ApiListener : ConfigObject default {{{ return -1; }}} }; - [config, deprecated] double tls_handshake_timeout { + [config, deprecated, no_storage] double tls_handshake_timeout { get; set; default {{{ return Configuration::TlsHandshakeTimeout; }}} diff --git a/lib/remote/configpackageshandler.cpp b/lib/remote/configpackageshandler.cpp index 7987092bc..6697a6371 100644 --- a/lib/remote/configpackageshandler.cpp +++ b/lib/remote/configpackageshandler.cpp @@ -28,11 +28,11 @@ bool ConfigPackagesHandler::HandleRequest( return false; if (request.method() == http::verb::get) - HandleGet(user, request, url, response, params); + HandleGet(user, response, params); else if (request.method() == http::verb::post) - HandlePost(user, request, url, response, params); + HandlePost(user, url, response, params); else if (request.method() == http::verb::delete_) - HandleDelete(user, request, url, response, params); + HandleDelete(user, url, response, params); else return false; @@ -41,8 +41,6 @@ bool ConfigPackagesHandler::HandleRequest( void ConfigPackagesHandler::HandleGet( const ApiUser::Ptr& user, - boost::beast::http::request& request, - const Url::Ptr& url, boost::beast::http::response& response, const Dictionary::Ptr& params ) @@ -91,7 +89,6 @@ void ConfigPackagesHandler::HandleGet( void ConfigPackagesHandler::HandlePost( const ApiUser::Ptr& user, - boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, const Dictionary::Ptr& params @@ -137,7 +134,6 @@ void ConfigPackagesHandler::HandlePost( void ConfigPackagesHandler::HandleDelete( const ApiUser::Ptr& user, - boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, const Dictionary::Ptr& params diff --git a/lib/remote/configpackageshandler.hpp b/lib/remote/configpackageshandler.hpp index 2bae0e265..9454cb632 100644 --- a/lib/remote/configpackageshandler.hpp +++ b/lib/remote/configpackageshandler.hpp @@ -28,21 +28,17 @@ public: private: void HandleGet( const ApiUser::Ptr& user, - boost::beast::http::request& request, - const Url::Ptr& url, boost::beast::http::response& response, const Dictionary::Ptr& params ); void HandlePost( const ApiUser::Ptr& user, - boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, const Dictionary::Ptr& params ); void HandleDelete( const ApiUser::Ptr& user, - boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, const Dictionary::Ptr& params diff --git a/lib/remote/configstageshandler.cpp b/lib/remote/configstageshandler.cpp index 0dee5f25f..93c43e8b2 100644 --- a/lib/remote/configstageshandler.cpp +++ b/lib/remote/configstageshandler.cpp @@ -32,11 +32,11 @@ bool ConfigStagesHandler::HandleRequest( return false; if (request.method() == http::verb::get) - HandleGet(user, request, url, response, params); + HandleGet(user, url, response, params); else if (request.method() == http::verb::post) - HandlePost(user, request, url, response, params); + HandlePost(user, url, response, params); else if (request.method() == http::verb::delete_) - HandleDelete(user, request, url, response, params); + HandleDelete(user, url, response, params); else return false; @@ -45,7 +45,6 @@ bool ConfigStagesHandler::HandleRequest( void ConfigStagesHandler::HandleGet( const ApiUser::Ptr& user, - boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, const Dictionary::Ptr& params @@ -93,7 +92,6 @@ void ConfigStagesHandler::HandleGet( void ConfigStagesHandler::HandlePost( const ApiUser::Ptr& user, - boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, const Dictionary::Ptr& params @@ -176,7 +174,6 @@ void ConfigStagesHandler::HandlePost( void ConfigStagesHandler::HandleDelete( const ApiUser::Ptr& user, - boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, const Dictionary::Ptr& params diff --git a/lib/remote/configstageshandler.hpp b/lib/remote/configstageshandler.hpp index a26ddc49c..5b65e3966 100644 --- a/lib/remote/configstageshandler.hpp +++ b/lib/remote/configstageshandler.hpp @@ -29,21 +29,18 @@ public: private: void HandleGet( const ApiUser::Ptr& user, - boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, const Dictionary::Ptr& params ); void HandlePost( const ApiUser::Ptr& user, - boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, const Dictionary::Ptr& params ); void HandleDelete( const ApiUser::Ptr& user, - boost::beast::http::request& request, const Url::Ptr& url, boost::beast::http::response& response, const Dictionary::Ptr& params diff --git a/lib/remote/consolehandler.cpp b/lib/remote/consolehandler.cpp index c48821aae..8dea5bb4c 100644 --- a/lib/remote/consolehandler.cpp +++ b/lib/remote/consolehandler.cpp @@ -96,16 +96,15 @@ bool ConsoleHandler::HandleRequest( } if (methodName == "execute-script") - return ExecuteScriptHelper(request, response, params, command, session, sandboxed); + return ExecuteScriptHelper(response, params, command, session, sandboxed); else if (methodName == "auto-complete-script") - return AutocompleteScriptHelper(request, response, params, command, session, sandboxed); + return AutocompleteScriptHelper(response, params, command, session, sandboxed); HttpUtility::SendJsonError(response, params, 400, "Invalid method specified: " + methodName); return true; } -bool ConsoleHandler::ExecuteScriptHelper(boost::beast::http::request& request, - boost::beast::http::response& response, +bool ConsoleHandler::ExecuteScriptHelper(boost::beast::http::response& response, const Dictionary::Ptr& params, const String& command, const String& session, bool sandboxed) { namespace http = boost::beast::http; @@ -179,8 +178,7 @@ bool ConsoleHandler::ExecuteScriptHelper(boost::beast::http::request& request, - boost::beast::http::response& response, +bool ConsoleHandler::AutocompleteScriptHelper(boost::beast::http::response& response, const Dictionary::Ptr& params, const String& command, const String& session, bool sandboxed) { namespace http = boost::beast::http; diff --git a/lib/remote/consolehandler.hpp b/lib/remote/consolehandler.hpp index ba93d0001..c202e7e7b 100644 --- a/lib/remote/consolehandler.hpp +++ b/lib/remote/consolehandler.hpp @@ -37,11 +37,9 @@ public: static std::vector GetAutocompletionSuggestions(const String& word, ScriptFrame& frame); private: - static bool ExecuteScriptHelper(boost::beast::http::request& request, - boost::beast::http::response& response, + static bool ExecuteScriptHelper(boost::beast::http::response& response, const Dictionary::Ptr& params, const String& command, const String& session, bool sandboxed); - static bool AutocompleteScriptHelper(boost::beast::http::request& request, - boost::beast::http::response& response, + static bool AutocompleteScriptHelper(boost::beast::http::response& response, const Dictionary::Ptr& params, const String& command, const String& session, bool sandboxed); }; diff --git a/lib/remote/url.cpp b/lib/remote/url.cpp index 24a573184..8c395ce05 100644 --- a/lib/remote/url.cpp +++ b/lib/remote/url.cpp @@ -205,8 +205,6 @@ String Url::Format(bool onlyPathAndQuery, bool printCredentials) const String param; if (!m_Query.empty()) { - typedef std::pair > kv_pair; - for (const auto& kv : m_Query) { String key = Utility::EscapeString(kv.first, ACQUERY_ENCODE, false); if (param.IsEmpty()) diff --git a/test/icinga-legacytimeperiod.cpp b/test/icinga-legacytimeperiod.cpp index 5a32d9570..890dbe8da 100644 --- a/test/icinga-legacytimeperiod.cpp +++ b/test/icinga-legacytimeperiod.cpp @@ -396,7 +396,6 @@ void AdvancedHelper(const char *timestamp, DateTime from, DateTime to) BOOST_AUTO_TEST_CASE(advanced) { - tm tm_beg, tm_end, tm_ref; String timestamp; boost::posix_time::ptime begin; boost::posix_time::ptime end;