probably incorrectly delete support for non-standardized matrix srv record

This commit is contained in:
Jacob Taylor 2025-04-25 21:06:00 -07:00
parent 1c8ca527db
commit 78c2a07524

View file

@ -306,14 +306,12 @@ impl super::Service {
#[tracing::instrument(name = "srv", level = "debug", skip(self))] #[tracing::instrument(name = "srv", level = "debug", skip(self))]
async fn query_srv_record(&self, hostname: &'_ str) -> Result<Option<FedDest>> { async fn query_srv_record(&self, hostname: &'_ str) -> Result<Option<FedDest>> {
let hostnames =
[format!("_matrix-fed._tcp.{hostname}."), format!("_matrix._tcp.{hostname}.")];
for hostname in hostnames {
self.services.server.check_running()?; self.services.server.check_running()?;
debug!("querying SRV for {hostname:?}"); debug!("querying SRV for {hostname:?}");
let hostname = hostname.trim_end_matches('.');
let hostname_suffix = format!("_matrix-fed._tcp.{hostname}.");
let hostname = hostname_suffix.trim_end_matches('.');
match self.resolver.resolver.srv_lookup(hostname).await { match self.resolver.resolver.srv_lookup(hostname).await {
| Err(e) => Self::handle_resolve_error(&e, hostname)?, | Err(e) => Self::handle_resolve_error(&e, hostname)?,
| Ok(result) => { | Ok(result) => {
@ -328,7 +326,6 @@ impl super::Service {
})); }));
}, },
} }
}
Ok(None) Ok(None)
} }