keepsimple1 / mdns-sd

Rust library for mDNS based Service Discovery
Apache License 2.0
89 stars 38 forks source link

Always include subtype info if exists #146

Closed keepsimple1 closed 8 months ago

keepsimple1 commented 8 months ago

This is to fix issue #145 (partially it turns out ;-) )

Currently ServiceInfo only contains sub_domain info if the query targets the subtype. The sub_domain is None if it is generated for querying the parent service type.

Part of the reason is that we only store mappings from PTR to instance SRV, not the other way. Both parent type PTR and subtype PTR points to the same instance SRV. When querying the parent PTR, we wouldn't know about the subtype PTR from the instance SRV. This patch is to make the reverse lookup possible.