1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:17:35 +00:00

LookupServer: Propagate the errors from MulticastDNS::lookup()

This patch slightly change the signature of lookup() method
and propagates all the errors to the caller with help of ErrorOr.
This commit is contained in:
Alexander Narsudinov 2022-12-18 00:50:14 +03:00 committed by Andreas Kling
parent 767529ebf5
commit e279a1723b
3 changed files with 13 additions and 18 deletions

View file

@ -183,7 +183,7 @@ ErrorOr<Vector<Answer>> LookupServer::lookup(Name const& name, RecordType record
// Fourth, look up .local names using mDNS instead of DNS nameservers.
if (name.as_string().ends_with(".local"sv)) {
answers = m_mdns->lookup(name, record_type);
answers = TRY(m_mdns->lookup(name, record_type));
for (auto& answer : answers)
put_in_cache(answer);
return answers;