diff options
author | Richard van der Hoff <richard@matrix.org> | 2019-01-31 23:13:44 +0000 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2019-01-31 23:14:18 +0000 |
commit | d428b463465a24a9922bbc759198398377b76d0a (patch) | |
tree | f1cb5b8aae82b5d725fee558fa13d0a13af8bcc5 /synapse/http | |
parent | v0.99.0rc3 (diff) | |
download | synapse-d428b463465a24a9922bbc759198398377b76d0a.tar.xz |
Update federation routing logic to check .well-known before SRV
Diffstat (limited to 'synapse/http')
-rw-r--r-- | synapse/http/federation/matrix_federation_agent.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/synapse/http/federation/matrix_federation_agent.py b/synapse/http/federation/matrix_federation_agent.py index 26649e70be..57dcab4727 100644 --- a/synapse/http/federation/matrix_federation_agent.py +++ b/synapse/http/federation/matrix_federation_agent.py @@ -210,11 +210,7 @@ class MatrixFederationAgent(object): target_port=parsed_uri.port, )) - # try a SRV lookup - service_name = b"_matrix._tcp.%s" % (parsed_uri.host,) - server_list = yield self._srv_resolver.resolve_service(service_name) - - if not server_list and lookup_well_known: + if lookup_well_known: # try a .well-known lookup well_known_server = yield self._get_well_known(parsed_uri.host) @@ -250,6 +246,10 @@ class MatrixFederationAgent(object): res = yield self._route_matrix_uri(new_uri, lookup_well_known=False) defer.returnValue(res) + # try a SRV lookup + service_name = b"_matrix._tcp.%s" % (parsed_uri.host,) + server_list = yield self._srv_resolver.resolve_service(service_name) + if not server_list: target_host = parsed_uri.host port = 8448 |