diff --git a/include/ircd/conf.h b/include/ircd/conf.h index 92cc552a5..2523a0bc6 100644 --- a/include/ircd/conf.h +++ b/include/ircd/conf.h @@ -55,6 +55,9 @@ namespace ircd::conf using set_cb = std::function; + const size_t NAME_MAX_LEN {127}; + const size_t VALUE_MAX_LEN {48_KiB}; + extern std::map *> items; extern callbacks &)> on_init; @@ -76,8 +79,6 @@ namespace ircd::conf template<> struct ircd::conf::item { - static const size_t NAME_MAX_LEN; - json::strung feature_; json::object feature; string_view name; diff --git a/ircd/conf.cc b/ircd/conf.cc index c29df9ed1..4ddeccdef 100644 --- a/ircd/conf.cc +++ b/ircd/conf.cc @@ -194,12 +194,6 @@ ircd::conf::exists(const string_view &key) // item // -decltype(ircd::conf::item::NAME_MAX_LEN) -ircd::conf::item::NAME_MAX_LEN -{ - 127 -}; - /// Conf item abstract constructor. ircd::conf::item::item(const json::members &opts, conf::set_cb set_cb) @@ -376,8 +370,8 @@ void ircd::conf::call_env(item &item) noexcept try { - assert(size(item.name) <= item.NAME_MAX_LEN); - thread_local char key[conf::item::NAME_MAX_LEN]; + assert(size(item.name) <= conf::NAME_MAX_LEN); + thread_local char key[conf::NAME_MAX_LEN]; const string_view name { key,