diff options
author | Richard van der Hoff <github@rvanderhoff.org.uk> | 2017-12-18 22:34:50 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-18 22:34:50 +0000 |
commit | 48fa4e1e5b102cad4690786ec1f54b93aa90a6db (patch) | |
tree | c1c1097431e4398de9a02107f9a98075efd230df /synapse/app/federation_sender.py | |
parent | Merge pull request #2717 from matrix-org/erikj/createroom_content (diff) | |
parent | Implement listen_tcp method in remaining workers (diff) | |
download | synapse-48fa4e1e5b102cad4690786ec1f54b93aa90a6db.tar.xz |
Merge pull request #2435 from silkeh/listen-ipv6-default
Adapt the default config to bind on both IPv4 and IPv6 on all platforms
Diffstat (limited to 'synapse/app/federation_sender.py')
-rw-r--r-- | synapse/app/federation_sender.py | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/synapse/app/federation_sender.py b/synapse/app/federation_sender.py index 389e3909d1..09e9488f06 100644 --- a/synapse/app/federation_sender.py +++ b/synapse/app/federation_sender.py @@ -106,17 +106,16 @@ class FederationSenderServer(HomeServer): root_resource = create_resource_tree(resources, Resource()) - for address in bind_addresses: - reactor.listenTCP( - port, - SynapseSite( - "synapse.access.http.%s" % (site_tag,), - site_tag, - listener_config, - root_resource, - ), - interface=address + _base.listen_tcp( + bind_addresses, + port, + SynapseSite( + "synapse.access.http.%s" % (site_tag,), + site_tag, + listener_config, + root_resource, ) + ) logger.info("Synapse federation_sender now listening on port %d", port) @@ -125,18 +124,15 @@ class FederationSenderServer(HomeServer): if listener["type"] == "http": self._listen_http(listener) elif listener["type"] == "manhole": - bind_addresses = listener["bind_addresses"] - - for address in bind_addresses: - reactor.listenTCP( - listener["port"], - manhole( - username="matrix", - password="rabbithole", - globals={"hs": self}, - ), - interface=address + _base.listen_tcp( + listener["bind_addresses"], + listener["port"], + manhole( + username="matrix", + password="rabbithole", + globals={"hs": self}, ) + ) else: logger.warn("Unrecognized listener type: %s", listener["type"]) |