File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -3480,6 +3480,22 @@ static void _mdns_search_send_pcb(mdns_search_once_t * search, tcpip_adapter_if_
3480
3480
*/
3481
3481
static void _mdns_search_send (mdns_search_once_t * search )
3482
3482
{
3483
+ mdns_search_once_t * queue = _mdns_server -> search_once ;
3484
+ bool found = false;
3485
+ // looking for this search in active searches
3486
+ while (queue ) {
3487
+ if (queue == search ) {
3488
+ found = true;
3489
+ break ;
3490
+ }
3491
+ queue = queue -> next ;
3492
+ }
3493
+
3494
+ if (!found ) {
3495
+ // no longer active -> skip sending this search
3496
+ return ;
3497
+ }
3498
+
3483
3499
uint8_t i , j ;
3484
3500
for (i = 0 ; i < TCPIP_ADAPTER_IF_MAX ; i ++ ) {
3485
3501
for (j = 0 ; j < MDNS_IP_PROTOCOL_MAX ; j ++ ) {
@@ -3822,12 +3838,13 @@ static void _mdns_scheduler_run()
3822
3838
*/
3823
3839
static void _mdns_search_run ()
3824
3840
{
3841
+ MDNS_SERVICE_LOCK ();
3825
3842
mdns_search_once_t * s = _mdns_server -> search_once ;
3826
3843
uint32_t now = xTaskGetTickCount () * portTICK_PERIOD_MS ;
3827
3844
if (!s ) {
3845
+ MDNS_SERVICE_UNLOCK ();
3828
3846
return ;
3829
3847
}
3830
- MDNS_SERVICE_LOCK ();
3831
3848
while (s ) {
3832
3849
if (s -> state != SEARCH_OFF ) {
3833
3850
if (now > (s -> started_at + s -> timeout )) {
You can’t perform that action at this time.
0 commit comments