From 658179fa9379f7d64d8c3bd942839b55923b973c Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Thu, 20 Apr 2023 17:40:48 -0700 Subject: [PATCH] [dns-client] fix finalizing query from `HandleTimer()` (#8982) This commit fixes an issue in `HandleTimer()` where we need to use `break` instead of `continue` after calling `FinalizeQuery()`. Note that we now have two loops, an outer loop on `mMainQueries` and then an inner loop on queries associated with a `mainQuery`. When we finalize a query, its related `mainQuery` (along with all its sub-queries) are finalized and removed. --- src/core/net/dns_client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/net/dns_client.cpp b/src/core/net/dns_client.cpp index 043114742..922863390 100644 --- a/src/core/net/dns_client.cpp +++ b/src/core/net/dns_client.cpp @@ -1450,7 +1450,7 @@ void Client::HandleTimer(void) if (info.mTransmissionCount >= info.mConfig.GetMaxTxAttempts()) { FinalizeQuery(*query, kErrorResponseTimeout); - continue; + break; } IgnoreError(SendQuery(*query, info, /* aUpdateTimer */ false));