Main: Add debug output for resolving server names

This commit is contained in:
networkException 2024-09-20 20:05:14 +02:00
parent e4cecf1bf5
commit 82a76a17af
Signed by: networkException
GPG key ID: E3877443AE684391

View file

@ -83,11 +83,19 @@ async fn process_media(source: MediaSource, body: Option<String>, server: Option
let media_id = uri.media_id()?; let media_id = uri.media_id()?;
let client = match server { let client = match server {
Some(ref url) => Client::builder().server_name_or_homeserver_url(url), Some(ref url) => {
debug!("Resolving server name or homeserver url '{url}' from command line");
Client::builder().server_name_or_homeserver_url(url)
},
// NOTE: We know that server_name is not a URL at this point, however if resolving .well-known // NOTE: We know that server_name is not a URL at this point, however if resolving .well-known
// delegation fails falling back to interpreting the server name as the base URL is somewhat // delegation fails falling back to interpreting the server name as the base URL is somewhat
// more resilient. Just had this now. // more resilient. Just had this now.
None => Client::builder().server_name_or_homeserver_url(server_name), None => {
debug!("Resolving server name or homeserver url '{server_name}' mxc uri '{uri}'");
Client::builder().server_name_or_homeserver_url(server_name)
},
}.build().await?; }.build().await?;
debug!("Downloading {} from {}", uri, client.homeserver()); debug!("Downloading {} from {}", uri, client.homeserver());