Skip to content

Commit 9e1b9cd

Browse files
authored
Merge pull request #929 from david-cermak/bump/mdns_v1.9
[mdns]: Bump version to `v1.9`
2 parents 1ceb42c + 9ef228f commit 9e1b9cd

File tree

4 files changed

+62
-2
lines changed

4 files changed

+62
-2
lines changed

components/mdns/.cz.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ commitizen:
33
bump_message: 'bump(mdns): $current_version -> $new_version'
44
pre_bump_hooks: python ../../ci/changelog.py mdns
55
tag_format: mdns-v$version
6-
version: 1.8.2
6+
version: 1.9.0
77
version_files:
88
- idf_component.yml

components/mdns/CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Changelog
22

3+
## [1.9.0](https://github.com/espressif/esp-protocols/commits/mdns-v1.9.0)
4+
5+
### Features
6+
7+
- support null value for boolean txt records ([fa96de3b](https://github.com/espressif/esp-protocols/commit/fa96de3b))
8+
9+
### Bug Fixes
10+
11+
- Add test case for bool/NULL txt handling ([5068f221](https://github.com/espressif/esp-protocols/commit/5068f221))
12+
- Temporary fix for build issues on IDF master ([0197c994](https://github.com/espressif/esp-protocols/commit/0197c994))
13+
- Add tests for delegated answers ([487a746d](https://github.com/espressif/esp-protocols/commit/487a746d))
14+
- Add fuzzing into mdns CI ([af6bb1b5](https://github.com/espressif/esp-protocols/commit/af6bb1b5))
15+
- Host test to use hw_support include dir ([8bba3a97](https://github.com/espressif/esp-protocols/commit/8bba3a97))
16+
- Fixes case where we create our own malloc/free allocators, therefore we need to call mdns_mem_free and not free ([63bf7091](https://github.com/espressif/esp-protocols/commit/63bf7091))
17+
- put srv/txt records in additional section for ptr queries ([b7b8c5db](https://github.com/espressif/esp-protocols/commit/b7b8c5db))
18+
19+
### Updated
20+
21+
- ci(common): Update test component dir for IDFv6.0 ([18418c83](https://github.com/espressif/esp-protocols/commit/18418c83))
22+
323
## [1.8.2](https://github.com/espressif/esp-protocols/commits/mdns-v1.8.2)
424

525
### Bug Fixes

components/mdns/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "1.8.2"
1+
version: "1.9.0"
22
description: "Multicast UDP service used to provide local network service and host discovery."
33
url: "https://github.com/espressif/esp-protocols/tree/master/components/mdns"
44
issues: "https://github.com/espressif/esp-protocols/issues"

components/mdns/tests/unit_test/main/test_mdns.c

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,45 @@ TEST(mdns, init_deinit)
6161
esp_event_loop_delete_default();
6262
}
6363

64+
TEST(mdns, boolean_txt_null_value)
65+
{
66+
mdns_result_t *results = NULL;
67+
test_case_uses_tcpip();
68+
TEST_ASSERT_EQUAL(ESP_OK, esp_event_loop_create_default());
69+
TEST_ASSERT_EQUAL(ESP_OK, mdns_init());
70+
TEST_ASSERT_EQUAL(ESP_OK, mdns_hostname_set(MDNS_HOSTNAME));
71+
72+
TEST_ASSERT_EQUAL(ESP_OK, mdns_service_add(MDNS_INSTANCE, MDNS_SERVICE_NAME, MDNS_SERVICE_PROTO, MDNS_SERVICE_PORT, NULL, 0));
73+
74+
mdns_txt_item_t txt_data[] = {
75+
{"bool", NULL},
76+
{"key", "value"},
77+
};
78+
const size_t txt_data_count = sizeof(txt_data) / sizeof(txt_data[0]);
79+
TEST_ASSERT_EQUAL(ESP_OK, mdns_service_txt_set(MDNS_SERVICE_NAME, MDNS_SERVICE_PROTO, txt_data, txt_data_count));
80+
yield_to_all_priorities();
81+
82+
TEST_ASSERT_EQUAL(ESP_OK, mdns_lookup_selfhosted_service(NULL, MDNS_SERVICE_NAME, MDNS_SERVICE_PROTO, 1, &results));
83+
TEST_ASSERT_NOT_EQUAL(NULL, results);
84+
TEST_ASSERT_NOT_EQUAL(NULL, results->txt);
85+
TEST_ASSERT_EQUAL(txt_data_count, results->txt_count);
86+
87+
bool found_bool = false;
88+
for (size_t i = 0; i < results->txt_count; ++i) {
89+
if (strcmp(results->txt[i].key, "bool") == 0) {
90+
TEST_ASSERT_NOT_EQUAL(NULL, results->txt_value_len);
91+
TEST_ASSERT_EQUAL_UINT8(0, results->txt_value_len[i]);
92+
found_bool = true;
93+
}
94+
}
95+
TEST_ASSERT_TRUE(found_bool);
96+
mdns_query_results_free(results);
97+
98+
TEST_ASSERT_EQUAL(ESP_OK, mdns_service_remove(MDNS_SERVICE_NAME, MDNS_SERVICE_PROTO));
99+
mdns_free();
100+
esp_event_loop_delete_default();
101+
}
102+
64103
TEST(mdns, api_fails_with_expected_err)
65104
{
66105
mdns_txt_item_t serviceTxtData[CONFIG_MDNS_MAX_SERVICES] = { {NULL, NULL},
@@ -290,6 +329,7 @@ TEST_GROUP_RUNNER(mdns)
290329
RUN_TEST_CASE(mdns, init_deinit)
291330
RUN_TEST_CASE(mdns, add_remove_service)
292331
RUN_TEST_CASE(mdns, add_remove_deleg_service)
332+
RUN_TEST_CASE(mdns, boolean_txt_null_value)
293333

294334
}
295335

0 commit comments

Comments
 (0)