changeset 8a1a607ca026 in /home/hg/repos/gajim
author: Emmanuel Gil Peyrot linkmauve@linkmauve.fr branches: details:http://hg.gajim.org/gajim?cmd=changeset;node=8a1a607ca026 description: Fix zeroconf connection and prevent invalid stanzas from being sent.
diffstat:
src/common/zeroconf/client_zeroconf.py | 7 +++++-- src/common/zeroconf/zeroconf_avahi.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-)
diffs (30 lines):
diff -r 634cd110eee2 -r 8a1a607ca026 src/common/zeroconf/client_zeroconf.py --- a/src/common/zeroconf/client_zeroconf.py Sun Apr 03 14:50:47 2016 +0200 +++ b/src/common/zeroconf/client_zeroconf.py Sat Apr 02 15:29:26 2016 +0100 @@ -753,9 +753,12 @@
def send(self, stanza, is_message=False, now=False, on_ok=None, on_not_ok=None): + to = stanza.getTo() + if to is None: + # Can’t send undirected stanza over Zeroconf. + return -1 + to = gajim.get_jid_without_resource(to) stanza.setFrom(self.roster.zeroconf.name) - to = stanza.getTo() - to = gajim.get_jid_without_resource(to)
try: item = self.roster[to] diff -r 634cd110eee2 -r 8a1a607ca026 src/common/zeroconf/zeroconf_avahi.py --- a/src/common/zeroconf/zeroconf_avahi.py Sun Apr 03 14:50:47 2016 +0200 +++ b/src/common/zeroconf/zeroconf_avahi.py Sat Apr 02 15:29:26 2016 +0100 @@ -144,7 +144,7 @@ val += c if val is None: # missing '=' val = '' - txt_dict[key] = val.decode('utf-8', 'ignore') + txt_dict[key] = val return txt_dict
def service_resolved_callback(self, interface, protocol, name, stype, domain,