modules/client/keys/claim: Restore when_any() loop to smooth remote handling.
This commit is contained in:
parent
feb4ac1fd3
commit
cd2b92b8fe
|
@ -228,9 +228,29 @@ recv_responses(const host_users_map &map,
|
|||
}
|
||||
|
||||
// remote handle
|
||||
for(auto &[remote, request] : queries)
|
||||
while(!queries.empty())
|
||||
{
|
||||
assert(!failures.count(remote));
|
||||
auto next
|
||||
{
|
||||
ctx::when_any(begin(queries), end(queries), []
|
||||
(auto &it) -> m::fed::user::keys::claim &
|
||||
{
|
||||
return it->second;
|
||||
})
|
||||
};
|
||||
|
||||
const bool ok
|
||||
{
|
||||
next.wait_until(timeout, std::nothrow)
|
||||
};
|
||||
|
||||
const auto it(next.get());
|
||||
const unwind remove{[&queries, &it]
|
||||
{
|
||||
queries.erase(it);
|
||||
}};
|
||||
|
||||
auto &[remote, request] {*it};
|
||||
recv_response(remote, request, failures, one_time_keys, timeout);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue