mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-12-06 00:59:29 +01:00
feat(mdns): support null value for boolean txt records
Forward port of fa96de3bd
This commit is contained in:
@@ -282,6 +282,7 @@ static mdns_txt_linked_item_t *allocate_txt(size_t num_items, mdns_txt_item_t tx
|
||||
mdns_mem_free(new_item);
|
||||
break;
|
||||
}
|
||||
if (txt[i].value) {
|
||||
new_item->value = mdns_mem_strdup(txt[i].value);
|
||||
if (!new_item->value) {
|
||||
mdns_mem_free((char *)new_item->key);
|
||||
@@ -289,6 +290,10 @@ static mdns_txt_linked_item_t *allocate_txt(size_t num_items, mdns_txt_item_t tx
|
||||
break;
|
||||
}
|
||||
new_item->value_len = strlen(new_item->value);
|
||||
} else {
|
||||
new_item->value = NULL;
|
||||
new_item->value_len = 0;
|
||||
}
|
||||
new_item->next = new_txt;
|
||||
new_txt = new_item;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user