Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[common] Cleanup mDNS code, cache service records #263

Merged
merged 6 commits into from
Sep 5, 2024

Conversation

szupi-ipuzs
Copy link
Contributor

I have noticed that if a service is not added to any net_if at the initial call to addServiceImpl(), then it is not stored at all. This is not correct, because a net_if might be nonexisting/down at the time, but later might be up and announced via mdns_netif_ext_status_callback. So all the services added via addServiceImpl should be cached always.
While fixing this I have noticed that the many static vectors can really be merged into a vector of CachedService structure - it makes usage much easier and it cleans-up after itself.

Tested this with some extent using a unit test and on a real device.

@Cossid
Copy link
Collaborator

Cossid commented Mar 10, 2024

Doesn't solve the other outstanding issues, but appears to function fine in the known-working cases here.

@kuba2k2 kuba2k2 added bug Something isn't working quality Code quality or safety improvements common Common for all families labels Apr 7, 2024
@szupi-ipuzs
Copy link
Contributor Author

Anything else needed to merge it? I use this code on every device I have since this PR was added and I have not noticed any issues.

@kuba2k2 kuba2k2 changed the title Mdns more fixes [common] Cleanup mDNS code, cache service records Sep 5, 2024
@kuba2k2 kuba2k2 merged commit 31e1d51 into libretiny-eu:master Sep 5, 2024
2 checks passed
@szupi-ipuzs szupi-ipuzs deleted the mdns_more_fixes branch September 5, 2024 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working common Common for all families quality Code quality or safety improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants