Skip to content
Snippets Groups Projects
Unverified Commit b0f4119b authored by Marcus's avatar Marcus Committed by GitHub
Browse files

Add debug logging to DNS SRV requests. (#9305)

parent 3f534d3f
No related branches found
No related tags found
No related merge requests found
Add debug logging for SRV lookups. Contributed by @Bubu.
......@@ -323,12 +323,19 @@ class MatrixHostnameEndpoint:
if port or _is_ip_literal(host):
return [Server(host, port or 8448)]
logger.debug("Looking up SRV record for %s", host.decode(errors="replace"))
server_list = await self._srv_resolver.resolve_service(b"_matrix._tcp." + host)
if server_list:
logger.debug(
"Got %s from SRV lookup for %s",
", ".join(map(str, server_list)),
host.decode(errors="replace"),
)
return server_list
# No SRV records, so we fallback to host and 8448
logger.debug("No SRV records for %s", host.decode(errors="replace"))
return [Server(host, 8448)]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment