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

modules/m_keys: Fix feds::keys result interpretation.

This commit is contained in:
Jason Volk 2019-09-05 18:27:51 -07:00
parent 51c6620e2c
commit b0e60fc3fc

View file

@ -398,6 +398,8 @@ ircd::m::keys::get(const queries &queries,
opts.reserve(queries.size());
for(const auto &[server_name, key_id] : queries)
{
assert(key_id);
assert(server_name);
const bool cached
{
cache::get(server_name, key_id, [&ret, &closure]
@ -442,12 +444,17 @@ ircd::m::keys::get(const queries &queries,
m::feds::execute(opts, [&ret, &closure]
(const auto &result)
{
if(empty(result.object))
const json::array &server_keys
{
result.object["server_keys"]
};
if(empty(server_keys))
return true;
const m::keys keys
{
result.object
server_keys
};
if(!verify(keys, std::nothrow))