chore: refactor default peer

This commit is contained in:
Michel de Graaf
2025-11-04 18:48:32 +01:00
parent c346c56297
commit d11c6782a7
8 changed files with 154 additions and 168 deletions
+4 -3
View File
@@ -310,7 +310,7 @@ impl Client {
download.username.clone(),
peer.host.clone(),
peer.port,
download.token,
token,
false,
own_username,
);
@@ -500,7 +500,7 @@ impl Client {
let peer_clone = peer.clone();
let sender_clone = sender;
unlocked_context.thread_pool.execute(move || {
trace!("[client] connecting to {}, with connection_type: {}", peer.username, peer.connection_type);
trace!("[client] connecting to {}, with connection_type: {}, and token {:?}", peer.username, peer.connection_type, peer.token);
match peer.connection_type {
ConnectionType::P => {
let default_peer =
@@ -530,7 +530,7 @@ impl Client {
}
ConnectionType::F => {
trace!("[client] downloading from: {}", peer.username);
trace!("[client] downloading from: {}, {:?}", peer.username, peer.token);
let download_peer = DownloadPeer::new(
peer.username,
peer.host,
@@ -547,6 +547,7 @@ impl Client {
) {
Ok((download, filename)) => {
trace!("[client] downloaded {} bytes {:?} ", filename, download.size);
download.sender.send(DownloadStatus::Completed).unwrap();
}
Err(e) => {
trace!("[client] failed to download: {}", e);