From d4e693e3928e01012bc0ebb582bf712e8436cb26 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Wed, 20 Mar 2024 11:40:11 +0100 Subject: [PATCH] fix(mdns): Schedule all queued Tx packets from timer task Co-Authored-By: not-my-real-name Partially addresses: https://github.com/espressif/esp-idf/issues/13333 --- components/mdns/mdns.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/mdns/mdns.c b/components/mdns/mdns.c index 7321214b0..5dcc40b7b 100644 --- a/components/mdns/mdns.c +++ b/components/mdns/mdns.c @@ -5191,7 +5191,7 @@ static void _mdns_scheduler_run(void) MDNS_SERVICE_UNLOCK(); return; } - if ((int32_t)(p->send_at - (xTaskGetTickCount() * portTICK_PERIOD_MS)) < 0) { + while (p && (int32_t)(p->send_at - (xTaskGetTickCount() * portTICK_PERIOD_MS)) < 0) { action = (mdns_action_t *)malloc(sizeof(mdns_action_t)); if (action) { action->type = ACTION_TX_HANDLE; @@ -5203,8 +5203,10 @@ static void _mdns_scheduler_run(void) } } else { HOOK_MALLOC_FAILED; - // continue + break; } + //Find the next unqued packet + p = p->next; } MDNS_SERVICE_UNLOCK(); }