libretiny-eu / libretiny

PlatformIO development platform for IoT modules
http://docs.libretiny.eu/
MIT License
382 stars 55 forks source link

Mdns more fixes #263

Open szupi-ipuzs opened 3 months ago

szupi-ipuzs commented 3 months ago

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 commented 3 months ago

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

szupi-ipuzs commented 1 month ago

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.