From cb346511002baec00d8464b69433641f150246fd Mon Sep 17 00:00:00 2001 From: Andy Newton Date: Thu, 5 Sep 2024 17:15:48 -0400 Subject: [PATCH 1/2] fixes #74 --- icann-rdap-cli/src/query.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/icann-rdap-cli/src/query.rs b/icann-rdap-cli/src/query.rs index 0daeced..a40a9d6 100644 --- a/icann-rdap-cli/src/query.rs +++ b/icann-rdap-cli/src/query.rs @@ -2,6 +2,7 @@ use icann_rdap_common::check::traverse_checks; use icann_rdap_common::check::CheckClass; use icann_rdap_common::check::CheckParams; use icann_rdap_common::check::GetChecks; +use tracing::debug; use tracing::error; use tracing::info; @@ -80,6 +81,7 @@ async fn do_domain_query<'a, W: std::io::Write>( let mut transactions = RequestResponses::new(); let base_url = get_base_url(&processing_params.bootstrap_type, client, query_type).await?; let response = do_request(&base_url, query_type, processing_params, client).await; + let registrar_response; match response { Ok(response) => { let source_host = response.http_data.host.to_owned(); @@ -106,11 +108,13 @@ async fn do_domain_query<'a, W: std::io::Write>( if let Some(url) = get_related_link(&response.rdap).first() { info!("Querying domain name from registrar."); let query_type = QueryType::Url(url.to_string()); - let registrar_response = + debug!("issuing request with query type {query_type} for base URL {base_url}"); + let registrar_response_result = do_request(&base_url, &query_type, processing_params, client).await; - match registrar_response { - Ok(registrar_response) => { - regr_source_host = registrar_response.http_data.host; + match registrar_response_result { + Ok(response_data) => { + registrar_response = response_data; + regr_source_host = registrar_response.http_data.host.to_owned(); regr_req_data = RequestData { req_number: 2, source_host: ®r_source_host, @@ -119,7 +123,7 @@ async fn do_domain_query<'a, W: std::io::Write>( transactions = do_output( processing_params, ®r_req_data, - &response, + ®istrar_response, write, transactions, )?; From 7bbe9aee76cc5f19ade71edae8c5a0583afc979b Mon Sep 17 00:00:00 2001 From: Andy Newton Date: Fri, 6 Sep 2024 05:43:11 -0400 Subject: [PATCH 2/2] removed from debug messages that should have been removed --- icann-rdap-cli/src/query.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/icann-rdap-cli/src/query.rs b/icann-rdap-cli/src/query.rs index a40a9d6..61bb57a 100644 --- a/icann-rdap-cli/src/query.rs +++ b/icann-rdap-cli/src/query.rs @@ -2,7 +2,6 @@ use icann_rdap_common::check::traverse_checks; use icann_rdap_common::check::CheckClass; use icann_rdap_common::check::CheckParams; use icann_rdap_common::check::GetChecks; -use tracing::debug; use tracing::error; use tracing::info; @@ -108,7 +107,6 @@ async fn do_domain_query<'a, W: std::io::Write>( if let Some(url) = get_related_link(&response.rdap).first() { info!("Querying domain name from registrar."); let query_type = QueryType::Url(url.to_string()); - debug!("issuing request with query type {query_type} for base URL {base_url}"); let registrar_response_result = do_request(&base_url, &query_type, processing_params, client).await; match registrar_response_result {