mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
ircd::info: Add name string / agency strings.
This commit is contained in:
parent
622e0a56a6
commit
eaf8df25c2
4 changed files with 33 additions and 2 deletions
|
@ -13,6 +13,7 @@
|
|||
#define HAVE_IRCD_INFO_H
|
||||
|
||||
// legacy
|
||||
extern "C" const char *const ircd_name;
|
||||
extern "C" const char *const ircd_version;
|
||||
|
||||
/// Information & metadata about the library.
|
||||
|
@ -22,7 +23,10 @@ namespace ircd::info
|
|||
struct tc_version;
|
||||
|
||||
// Primary information
|
||||
extern const string_view name;
|
||||
extern const string_view version;
|
||||
extern const string_view user_agent;
|
||||
extern const string_view server_agent;
|
||||
|
||||
// Build information
|
||||
extern const time_t configured_time;
|
||||
|
|
|
@ -339,7 +339,10 @@ ircd::http::response::response(window_buffer &out,
|
|||
if(code >= 200 && code < 300)
|
||||
writeline(out, [&code](const mutable_buffer &out) -> size_t
|
||||
{
|
||||
return copy(out, "Server: " BRANDING_NAME " (IRCd " BRANDING_VERSION ")"_sv);
|
||||
size_t ret{0};
|
||||
ret += copy(out, "Server: "_sv);
|
||||
ret += copy(out + ret, ircd::info::server_agent);
|
||||
return ret;
|
||||
});
|
||||
|
||||
if(code < 400)
|
||||
|
|
24
ircd/info.cc
24
ircd/info.cc
|
@ -67,18 +67,42 @@ ircd::info::init()
|
|||
};
|
||||
}
|
||||
|
||||
extern "C" const char *const
|
||||
ircd_name
|
||||
{
|
||||
PACKAGE_NAME
|
||||
};
|
||||
|
||||
extern "C" const char *const
|
||||
ircd_version
|
||||
{
|
||||
RB_VERSION
|
||||
};
|
||||
|
||||
decltype(ircd::info::name)
|
||||
ircd::info::name
|
||||
{
|
||||
PACKAGE_NAME
|
||||
};
|
||||
|
||||
decltype(ircd::info::version)
|
||||
ircd::info::version
|
||||
{
|
||||
RB_VERSION
|
||||
};
|
||||
|
||||
decltype(ircd::info::user_agent)
|
||||
ircd::info::user_agent
|
||||
{
|
||||
BRANDING_NAME " (IRCd " BRANDING_VERSION ")"
|
||||
};
|
||||
|
||||
decltype(ircd::info::server_agent)
|
||||
ircd::info::server_agent
|
||||
{
|
||||
BRANDING_NAME " (IRCd " BRANDING_VERSION ")"
|
||||
};
|
||||
|
||||
//
|
||||
// IRCd / build information
|
||||
//
|
||||
|
|
|
@ -79,7 +79,7 @@ const
|
|||
size_t headers{1};
|
||||
http::header header[headers + addl_headers_size]
|
||||
{
|
||||
{ "User-Agent", BRANDING_NAME " (IRCd " BRANDING_VERSION ")" },
|
||||
{ "User-Agent", info::user_agent }
|
||||
};
|
||||
|
||||
for(size_t i(0); i < addl_headers_size; ++i)
|
||||
|
|
Loading…
Reference in a new issue