0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 02:02:38 +01:00

ircd: Factor out the ircd::BUFSIZE; remove stale ircd::config extern.

This commit is contained in:
Jason Volk 2018-08-16 00:20:27 -07:00
parent 3f064ed172
commit 4199d5026c
4 changed files with 8 additions and 4 deletions

View file

@ -80,6 +80,11 @@ namespace ircd
struct ircd::exception struct ircd::exception
:std::exception :std::exception
{ {
static constexpr const size_t &BUFSIZE
{
512UL
};
protected: protected:
IRCD_OVERLOAD(generate_skip) IRCD_OVERLOAD(generate_skip)

View file

@ -18,9 +18,8 @@ namespace ircd
{ {
enum class runlevel :int; enum class runlevel :int;
constexpr size_t BUFSIZE { 512 };
extern const enum runlevel &runlevel; extern const enum runlevel &runlevel;
extern const std::string &config;
extern bool debugmode; ///< Toggle; available only ifdef RB_DEBUG extern bool debugmode; ///< Toggle; available only ifdef RB_DEBUG
extern bool nolisten; ///< Init option to not bind listener socks. extern bool nolisten; ///< Init option to not bind listener socks.
extern bool noautomod; ///< Option to not load modules on init. extern bool noautomod; ///< Option to not load modules on init.

View file

@ -2585,7 +2585,7 @@ ircd::js::replace_message(JSErrorReport &report,
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
char buf[BUFSIZE]; thread_local char buf[1024];
vsnprintf(buf, sizeof(buf), fmt, ap); vsnprintf(buf, sizeof(buf), fmt, ap);
const size_t ucsz(sizeof(buf) * 2); const size_t ucsz(sizeof(buf) * 2);

View file

@ -844,7 +844,7 @@ ircd::m::keys::init::signing()
static const auto trunc_size{8}; static const auto trunc_size{8};
self::public_key_id = fmt::snstringf self::public_key_id = fmt::snstringf
{ {
BUFSIZE, "ed25519:%s", trunc(public_key_hash_b58, trunc_size) 32, "ed25519:%s", trunc(public_key_hash_b58, trunc_size)
}; };
log.info("Current key is '%s' and the public key is: %s", log.info("Current key is '%s' and the public key is: %s",