0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-12 04:51:08 +01:00

ircd::conf: Improve item maximum related constants.

This commit is contained in:
Jason Volk 2019-07-27 14:06:23 -07:00
parent 63a9f33d7c
commit d806ef48db
2 changed files with 5 additions and 10 deletions

View file

@ -55,6 +55,9 @@ namespace ircd::conf
using set_cb = std::function<void ()>;
const size_t NAME_MAX_LEN {127};
const size_t VALUE_MAX_LEN {48_KiB};
extern std::map<string_view, item<> *> items;
extern callbacks<void (item<> &)> on_init;
@ -76,8 +79,6 @@ namespace ircd::conf
template<>
struct ircd::conf::item<void>
{
static const size_t NAME_MAX_LEN;
json::strung feature_;
json::object feature;
string_view name;

View file

@ -194,12 +194,6 @@ ircd::conf::exists(const string_view &key)
// item
//
decltype(ircd::conf::item<void>::NAME_MAX_LEN)
ircd::conf::item<void>::NAME_MAX_LEN
{
127
};
/// Conf item abstract constructor.
ircd::conf::item<void>::item(const json::members &opts,
conf::set_cb set_cb)
@ -376,8 +370,8 @@ void
ircd::conf::call_env(item<void> &item)
noexcept try
{
assert(size(item.name) <= item.NAME_MAX_LEN);
thread_local char key[conf::item<void>::NAME_MAX_LEN];
assert(size(item.name) <= conf::NAME_MAX_LEN);
thread_local char key[conf::NAME_MAX_LEN];
const string_view name
{
key,