shuttle: performed last needed changes to support build for shuttle deployment

This commit is contained in:
Patryk Hegenberg 2024-04-26 17:53:50 +02:00
parent ce1f80cd4f
commit 6fd67f5f4e
8 changed files with 43 additions and 65 deletions

View file

@ -44,10 +44,8 @@ use tokio_tungstenite::{
tungstenite::{client::IntoClientRequest, http::HeaderValue},
};
use tracing::error;
use url::Url;
pub async fn start_receiver(relay: &str, name: &str) {
let argument = name;
let Ok(mut request) = relay.into_client_request() else {
println!("Error: Failed to create request.");
return;
@ -66,17 +64,8 @@ pub async fn start_receiver(relay: &str, name: &str) {
return;
};
// If the URL is valid and contains an invite code fragment,
// extract it and pass it to the receiver::client::start
// function. The start function is defined in the
// The start function is defined in the
// receiver::client module and is the function that interacts with
// the server to receive files.
if let Ok(url) = Url::parse(argument) {
let Some(fragment) = url.fragment() else {
error!("Error: Missing invite code fragment in url.");
return;
};
receiver::start(socket, fragment).await
}
receiver::start(socket, name).await
}