diff --git a/xpra/client/gtk3/mdns_gui.py b/xpra/client/gtk3/mdns_gui.py index b788587371..3342dcb4c4 100644 --- a/xpra/client/gtk3/mdns_gui.py +++ b/xpra/client/gtk3/mdns_gui.py @@ -11,6 +11,7 @@ from xpra.client.gtk3.sessions_gui import SessionsGUI from xpra.net.mdns import XPRA_TCP_MDNS_TYPE, XPRA_UDP_MDNS_TYPE, get_listener_class +from xpra.os_util import bytestostr from xpra.util import envbool from xpra.log import Logger @@ -63,7 +64,11 @@ def mdns_add(self, interface, protocol, name, stype, domain, host, address, port log("mdns_add%s", (interface, protocol, name, stype, domain, host, address, port, text)) if HIDE_IPV6 and address.find(":")>=0: return - text = text or {} + # text record may be received as byte strings... + text_rec = {} + if text: + for key, value in text.items(): + text_rec[bytestostr(key)] = bytestostr(value) #strip service from hostname: #(win32 servers add it? why!?) if host: @@ -71,10 +76,9 @@ def mdns_add(self, interface, protocol, name, stype, domain, host, address, port host = host[:-len(stype)] elif stype and domain and host.endswith(stype+"."+domain): host = host[:-len(stype+"."+domain)] - if text: - mode = text.get("mode") - if mode and host.endswith(mode+"."): - host = host[:-len(mode+".")] + mode = text.get("mode") + if mode and host.endswith(mode+"."): + host = host[:-len(mode+".")] if host.endswith(".local."): host = host[:-len(".local.")] self.records.append((interface, protocol, name, stype, domain, host, address, port, text))