diff --git a/matrix/burst.cc b/matrix/burst.cc index 27a44d5b3..c684acdad 100644 --- a/matrix/burst.cc +++ b/matrix/burst.cc @@ -39,6 +39,8 @@ try string_view{node.node_id}, }; + fed::clear_error(node.node_id); + if(opts.cache_warming) if(ircd::uptime() < seconds(cache_warmup_time)) cache_warming(node, opts); diff --git a/matrix/feds.cc b/matrix/feds.cc index 859ebc7a2..56ca2873f 100644 --- a/matrix/feds.cc +++ b/matrix/feds.cc @@ -449,7 +449,7 @@ ircd::m::feds::for_each_in_room(const opts &opts, const auto errant { - server::errant(fed::matrix_service(origin)) + fed::errant(origin) }; if(opts.closure_cached_errors || !errant) try @@ -490,7 +490,7 @@ ircd::m::feds::for_one(const string_view &origin, const auto errant { - server::errant(fed::matrix_service(origin)) + fed::errant(origin) }; if(opts.closure_cached_errors || !errant) try diff --git a/matrix/fetch.cc b/matrix/fetch.cc index 3a82159ff..8ea24ef96 100644 --- a/matrix/fetch.cc +++ b/matrix/fetch.cc @@ -580,7 +580,7 @@ ircd::m::fetch::select_random_origin(request &request) return false; // Don't want to use a peer marked with an error by ircd::server - if(ircd::server::errant(fed::matrix_service(origin))) + if(fed::errant(origin)) return false; return true; diff --git a/matrix/resource.cc b/matrix/resource.cc index 8a664b9a5..599e1c11f 100644 --- a/matrix/resource.cc +++ b/matrix/resource.cc @@ -72,7 +72,7 @@ try // 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 && server::errclear(fed::matrix_service(request.node_id))) + if(request.node_id && fed::errant(request.node_id)) { m::burst::opts opts; m::burst::burst diff --git a/matrix/room_origins.cc b/matrix/room_origins.cc index 844fbb675..481e01ea3 100644 --- a/matrix/room_origins.cc +++ b/matrix/room_origins.cc @@ -117,7 +117,7 @@ const size_t ret{0}; for_each([&ret](const string_view &server) { - ret += server::errant(fed::matrix_service(server)); + ret += fed::errant(server); }); return ret; @@ -132,9 +132,9 @@ const 0 - ssize_t(count_error()) }; - for_each([&ret](const string_view &hostport) + for_each([&ret](const string_view &server) { - ret += bool(server::exists(fed::matrix_service(hostport))); + ret += bool(fed::exists(server)); }); assert(ret >= 0L); diff --git a/modules/console.cc b/modules/console.cc index 030b06b16..a33491f0a 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -5018,9 +5018,17 @@ console_cmd__peer(opt &out, const string_view &line) const bool conn(has(line, "conn")); if(hostport && !all && !active && !conn) { + char buf[rfc3986::DOMAIN_BUFSIZE]; + const auto remote + { + net::service(net::hostport(hostport)) == "matrix"? + m::fed::server(buf, hostport): + m::fed::matrix_service(hostport) + }; + auto &peer { - server::find(m::fed::matrix_service(hostport)) + server::find(remote) }; print_head(); @@ -5141,14 +5149,22 @@ console_cmd__peer__error__clear(opt &out, const string_view &line) if(empty(line)) return console_cmd__peer__error__clear__all(out, line); - const net::hostport hp + const string_view &input { token(line, ' ', 0) }; + char buf[rfc3986::DOMAIN_BUFSIZE]; + const net::hostport remote + { + service(net::hostport(input)) == "matrix"? + m::fed::server(buf, input): + m::fed::matrix_service(input) + }; + const auto cleared { - server::errclear(m::fed::matrix_service(hp)) + server::errclear(remote) }; out << std::boolalpha << cleared << std::endl; @@ -5230,14 +5246,22 @@ try "hostport" }}; - const auto &hostport + const auto &hp { - param.at(0) + param["hostport"] + }; + + char buf[rfc3986::DOMAIN_BUFSIZE]; + const net::hostport remote + { + service(net::hostport(hp)) == "matrix"? + m::fed::server(buf, hp): + m::fed::matrix_service(hp) }; auto &peer { - server::find(hostport) + server::find(remote) }; peer.cancel(); @@ -9474,7 +9498,7 @@ console_cmd__room__origins__random(opt &out, const string_view &line) const auto ok{[&noerror] (const string_view &origin) { - if(noerror && server::errant(m::fed::matrix_service(origin))) + if(noerror && m::fed::errant(origin)) return false; return true; diff --git a/modules/federation/query.cc b/modules/federation/query.cc index 6504800f4..dbe693cd7 100644 --- a/modules/federation/query.cc +++ b/modules/federation/query.cc @@ -199,7 +199,7 @@ get__query_directory(client &client, if(my_host(origin)) return true; - if(server::avail(m::fed::matrix_service(origin))) + if(m::fed::avail(origin)) return true; servers.append(origin); diff --git a/modules/federation/sender.cc b/modules/federation/sender.cc index 425d3f1cc..7b5ad8324 100644 --- a/modules/federation/sender.cc +++ b/modules/federation/sender.cc @@ -277,12 +277,7 @@ send_to_room(const m::event &event, if(my_host(origin)) return; - const auto remote - { - m::fed::matrix_service(origin) - }; - - if(server::errant(remote)) + if(m::fed::errant(origin)) return; auto it @@ -341,12 +336,7 @@ send_to_user(const m::event &event, if(my_host(origin)) return; - const auto remote - { - m::fed::matrix_service(origin) - }; - - if(server::errant(remote)) + if(m::fed::errant(origin)) return; auto it @@ -389,12 +379,7 @@ send_from_user(const m::event &event, if(my_host(origin)) return true; - const auto remote - { - m::fed::matrix_service(origin) - }; - - if(server::errant(remote)) + if(m::fed::errant(origin)) return true; auto it