mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibDNS: Fix deadlock when receiving invalid lookup result
Previously, we would stop the repeat timer even if we got a null result. This caused the pending lookup to: - Never resolve, and - Never get purged for too many retries I believe the underlying issue is something on the socket level, but we should handle this case regardless.
This commit is contained in:
parent
3f5e32ee84
commit
4a16c89603
|
|
@ -453,10 +453,11 @@ private:
|
|||
if (!lookup)
|
||||
return Error::from_string_literal("No pending lookup found for this message");
|
||||
|
||||
lookup->repeat_timer->stop();
|
||||
if (lookup->result.is_null())
|
||||
return {}; // Message is a response to a lookup that's been purged from the cache, ignore it
|
||||
|
||||
lookup->repeat_timer->stop();
|
||||
|
||||
auto result = lookup->result.strong_ref();
|
||||
for (auto& record : message.answers)
|
||||
result->add_record(move(record));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user