Handle `DNSNotImplementedError` in SRV resolver (#15523)
Signed-off-by: Zdzichu <zdzichu.rks@protonmail.com>pull/15548/head
parent
ad141efb47
commit
a0f53afd62
|
@ -0,0 +1 @@
|
|||
Don't fail on federation over TOR where SRV queries are not supported. Contributed by Zdzichu.
|
|
@ -22,7 +22,7 @@ import attr
|
|||
|
||||
from twisted.internet.error import ConnectError
|
||||
from twisted.names import client, dns
|
||||
from twisted.names.error import DNSNameError, DomainError
|
||||
from twisted.names.error import DNSNameError, DNSNotImplementedError, DomainError
|
||||
|
||||
from synapse.logging.context import make_deferred_yieldable
|
||||
|
||||
|
@ -145,6 +145,9 @@ class SrvResolver:
|
|||
# TODO: cache this. We can get the SOA out of the exception, and use
|
||||
# the negative-TTL value.
|
||||
return []
|
||||
except DNSNotImplementedError:
|
||||
# For .onion homeservers this is unavailable, just fallback to host:8448
|
||||
return []
|
||||
except DomainError as e:
|
||||
# We failed to resolve the name (other than a NameError)
|
||||
# Try something in the cache, else rereaise
|
||||
|
|
Loading…
Reference in New Issue