summaryrefslogtreecommitdiff
path: root/src/api/server_server.rs
diff options
context:
space:
mode:
authorTimo Kösters <timo@koesters.xyz>2023-02-23 11:20:40 +0100
committerTimo Kösters <timo@koesters.xyz>2023-03-13 10:39:18 +0100
commit2316d89048f78043af95a055f8c8cd45fae894f8 (patch)
treeffd3847b2cc63e579f0290f1ab99be48c63c08fc /src/api/server_server.rs
parentbde4880c1d169066e22e4c04288f8bce6c84b32f (diff)
downloadconduit-2316d89048f78043af95a055f8c8cd45fae894f8.zip
Even more logging
Diffstat (limited to 'src/api/server_server.rs')
-rw-r--r--src/api/server_server.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/api/server_server.rs b/src/api/server_server.rs
index 0247369..3bdbdef 100644
--- a/src/api/server_server.rs
+++ b/src/api/server_server.rs
@@ -125,6 +125,8 @@ where
return Err(Error::bad_config("Federation is disabled."));
}
+ info!("Preparing to send request to {destination}");
+
let mut write_destination_to_cache = false;
let cached_result = services()
@@ -231,11 +233,13 @@ where
let url = reqwest_request.url().clone();
+ info!("Sending request to {destination} at {url}");
let response = services()
.globals
.federation_client()
.execute(reqwest_request)
.await;
+ info!("Received response from {destination} at {url}");
match response {
Ok(mut response) => {
@@ -251,10 +255,12 @@ where
.expect("http::response::Builder is usable"),
);
+ info!("Getting response bytes from {destination}");
let body = response.bytes().await.unwrap_or_else(|e| {
warn!("server error {}", e);
Vec::new().into()
}); // TODO: handle timeout
+ info!("Got response bytes from {destination}");
if status != 200 {
warn!(
@@ -273,6 +279,7 @@ where
.expect("reqwest body is valid http body");
if status == 200 {
+ info!("Parsing response bytes from {destination}");
let response = T::IncomingResponse::try_from_http_response(http_response);
if response.is_ok() && write_destination_to_cache {
services()
@@ -294,6 +301,7 @@ where
Error::BadServerResponse("Server returned bad 200 response.")
})
} else {
+ info!("Returning error from {destination}");
Err(Error::FederationError(
destination.to_owned(),
RumaError::from_http_response(http_response),