From dcbe7e1dfdc0fdda37cb4172d89ab4765487e0cb Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 15 May 2014 10:13:32 +0200 Subject: [PATCH] Implement "accept_config" attribute. Refs #6191 --- lib/remote/apilistener-sync.cpp | 5 +++++ lib/remote/apilistener.ti | 2 ++ lib/remote/remote-type.conf | 2 ++ 3 files changed, 9 insertions(+) diff --git a/lib/remote/apilistener-sync.cpp b/lib/remote/apilistener-sync.cpp index 6938d24ab..78ae5cf06 100644 --- a/lib/remote/apilistener-sync.cpp +++ b/lib/remote/apilistener-sync.cpp @@ -158,6 +158,11 @@ Value ApiListener::ConfigUpdateHandler(const MessageOrigin& origin, const Dictio if (!origin.FromZone || !Zone::GetLocalZone()->IsChildOf(origin.FromZone)) return Empty; + ApiListener::Ptr listener = ApiListener::GetInstance(); + + if (!listener || !listener->GetAcceptConfig()) + return Empty; + Dictionary::Ptr update = params->Get("update"); bool configChange = false; diff --git a/lib/remote/apilistener.ti b/lib/remote/apilistener.ti index 381536c33..be7cd6b15 100644 --- a/lib/remote/apilistener.ti +++ b/lib/remote/apilistener.ti @@ -16,6 +16,8 @@ class ApiListener : DynamicObject default {{{ return "5665"; }}} }; + [config] bool accept_config; + [state] double log_message_timestamp; String identity; diff --git a/lib/remote/remote-type.conf b/lib/remote/remote-type.conf index bdf58db5f..b458ccd5e 100644 --- a/lib/remote/remote-type.conf +++ b/lib/remote/remote-type.conf @@ -31,6 +31,8 @@ %attribute %string "bind_host", %attribute %string "bind_port", + + %attribute %number "accept_config" } %type Endpoint {