From 82a76a17af9a100e2ab6f7ec3057feb7a0589c6f Mon Sep 17 00:00:00 2001 From: networkException Date: Fri, 20 Sep 2024 20:05:14 +0200 Subject: [PATCH] Main: Add debug output for resolving server names --- src/main.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 260186c..b67d75f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -83,11 +83,19 @@ async fn process_media(source: MediaSource, body: Option, server: Option let media_id = uri.media_id()?; 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 // delegation fails falling back to interpreting the server name as the base URL is somewhat // 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?; debug!("Downloading {} from {}", uri, client.homeserver());