mirror of
https://github.com/matrix-construct/construct
synced 2025-01-12 16:03:55 +01:00
ircd:Ⓜ️:resource: Add log facility w/ debug; minor cleanup.
This commit is contained in:
parent
d8115cccc9
commit
42f7b05775
2 changed files with 33 additions and 1 deletions
|
@ -23,6 +23,8 @@ struct ircd::m::resource
|
|||
struct method;
|
||||
struct request;
|
||||
|
||||
static log::log log;
|
||||
|
||||
using ircd::resource::resource;
|
||||
};
|
||||
|
||||
|
|
|
@ -19,6 +19,12 @@ namespace ircd::m
|
|||
static string_view authenticate_node(const resource::method &, const client &, resource::request &);
|
||||
}
|
||||
|
||||
decltype(ircd::m::resource::log)
|
||||
ircd::m::resource::log
|
||||
{
|
||||
"m.resource"
|
||||
};
|
||||
|
||||
decltype(ircd::m::x_matrix_verify_origin)
|
||||
ircd::m::x_matrix_verify_origin
|
||||
{
|
||||
|
@ -70,9 +76,33 @@ try
|
|||
*this, client, request_
|
||||
};
|
||||
|
||||
const string_view &ident
|
||||
{
|
||||
request.bridge_id?:
|
||||
request.node_id?:
|
||||
request.user_id?:
|
||||
string_view{}
|
||||
};
|
||||
|
||||
if(ident)
|
||||
log::debug
|
||||
{
|
||||
log, "%s %s %s `%s'",
|
||||
client.loghead(),
|
||||
ident,
|
||||
request.head.method,
|
||||
request.head.path,
|
||||
};
|
||||
|
||||
const bool cached_error
|
||||
{
|
||||
request.node_id
|
||||
&& fed::errant(request.node_id)
|
||||
};
|
||||
|
||||
// If we have an error cached from previously not being able to
|
||||
// contact this origin we can clear that now that they're alive.
|
||||
if(request.node_id && fed::errant(request.node_id))
|
||||
if(cached_error)
|
||||
{
|
||||
m::burst::opts opts;
|
||||
m::burst::burst
|
||||
|
|
Loading…
Reference in a new issue