fixed SRV query - should use dns.rdatatype.SRV
This commit is contained in:
parent
8e95ae2948
commit
3f41fdd231
@ -31,6 +31,7 @@ from . import plugins
|
|||||||
srvsupport = True
|
srvsupport = True
|
||||||
try:
|
try:
|
||||||
import dns.resolver
|
import dns.resolver
|
||||||
|
import dns.rdatatype
|
||||||
except ImportError:
|
except ImportError:
|
||||||
srvsupport = False
|
srvsupport = False
|
||||||
|
|
||||||
@ -102,7 +103,8 @@ class ClientXMPP(basexmpp, XMLStream):
|
|||||||
else:
|
else:
|
||||||
logging.debug("Since no address is supplied, attempting SRV lookup.")
|
logging.debug("Since no address is supplied, attempting SRV lookup.")
|
||||||
try:
|
try:
|
||||||
answers = dns.resolver.query("_xmpp-client._tcp.%s" % self.server)
|
answers = dns.resolver.query("_xmpp-client._tcp.%s" % self.domain,
|
||||||
|
dns.rdatatype.SRV )
|
||||||
except dns.resolver.NXDOMAIN:
|
except dns.resolver.NXDOMAIN:
|
||||||
logging.debug("No appropriate SRV record found. Using JID server name.")
|
logging.debug("No appropriate SRV record found. Using JID server name.")
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user