jbagg / QtZeroConf

Qt wrapper class for ZeroConf libraries across various platforms.
Other
69 stars 51 forks source link

avahicore and avahiclient: fixed TXT records update on existing services #52

Open morixhub opened 2 years ago

morixhub commented 2 years ago

Hello. I just noticed that using avahi (avahicore/avahiclient) TXT records of existing services are not getting updated properly...

I mean: if you have an existing service on the network and then update its TXT records somehow QtZeroConf successfully emits the corresponding serviceUpdated() signal, but the QZeroConfService object passed as parameter still references the previous TXT records (the records before the service update).

It's easy to fix that by simply re-processing TXT records before emitting the signal... the same process is already in place for newly-detected services and so it is enough to move the corresponding code block outside the if (considering the clear the m_txt collection anyway before doing that).