mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-19 15:58:56 +00: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: 4a16c89603
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)
|
if (!lookup)
|
||||||
return Error::from_string_literal("No pending lookup found for this message");
|
return Error::from_string_literal("No pending lookup found for this message");
|
||||||
|
|
||||||
lookup->repeat_timer->stop();
|
|
||||||
if (lookup->result.is_null())
|
if (lookup->result.is_null())
|
||||||
return {}; // Message is a response to a lookup that's been purged from the cache, ignore it
|
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();
|
auto result = lookup->result.strong_ref();
|
||||||
for (auto& record : message.answers)
|
for (auto& record : message.answers)
|
||||||
result->add_record(move(record));
|
result->add_record(move(record));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue