mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 09:12:13 -05: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
Notes:
github-actions[bot]
2024-12-01 10:36:50 +00:00
Author: https://github.com/rmg-x Commit: https://github.com/LadybirdBrowser/ladybird/commit/4a16c896036 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2649 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/awesomekling
1 changed files with 2 additions and 1 deletions
|
@ -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 a new issue