diff options
author | Tom Wambold <tom5760@gmail.com> | 2017-05-08 15:58:28 -0400 |
---|---|---|
committer | Tom Wambold <tom5760@gmail.com> | 2017-05-08 15:58:28 -0400 |
commit | c33749e57adb5cffdb5cc056cbc1f214191923bf (patch) | |
tree | 7a88a6624c9a2a1a8ebd3703676b344e0e701af2 /slixmpp/xmlstream/xmlstream.py | |
parent | e4107d8b4d57476721d4d383208fa785f6306a1f (diff) | |
download | slixmpp-c33749e57adb5cffdb5cc056cbc1f214191923bf.tar.gz slixmpp-c33749e57adb5cffdb5cc056cbc1f214191923bf.tar.bz2 slixmpp-c33749e57adb5cffdb5cc056cbc1f214191923bf.tar.xz slixmpp-c33749e57adb5cffdb5cc056cbc1f214191923bf.zip |
Fixes port being set to 0 when connecting via hostname.
This seems to be the same issue as:
https://dev.louiz.org/issues/3164
Using their suggested fix, if the DNS lookup doesn't return a port, use
the one passed in instead.
Diffstat (limited to 'slixmpp/xmlstream/xmlstream.py')
-rw-r--r-- | slixmpp/xmlstream/xmlstream.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py index 8daf99e4..db494ee2 100644 --- a/slixmpp/xmlstream/xmlstream.py +++ b/slixmpp/xmlstream/xmlstream.py @@ -289,7 +289,8 @@ class XMLStream(asyncio.BaseProtocol): record = yield from self.pick_dns_answer(self.default_domain) if record is not None: - host, address, port = record + host, address, dns_port = record + port = dns_port if dns_port else self.address[1] self.address = (address, port) self._service_name = host else: |