Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,870 changes: 1,187 additions & 683 deletions Cargo.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub async fn run(udp_trackers: Vec<Url>, timeout: Duration) -> Vec<Result<Checks

tracing::debug!("UDP trackers ...");

#[allow(clippy::incompatible_msrv)]
let info_hash = aquatic_udp_protocol::InfoHash(hex!("9c38422213e30bff212b30c360d26f9a02136422")); // DevSkim: ignore DS173237

for remote_url in udp_trackers {
Expand Down
2 changes: 1 addition & 1 deletion packages/http-protocol/src/v1/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl Query {
self.params.get_vec(name).map(|pairs| {
let mut param_values = vec![];
for pair in pairs {
param_values.push(pair.value.to_string());
param_values.push(pair.value.clone());
}
param_values
})
Expand Down
8 changes: 0 additions & 8 deletions packages/http-tracker-core/src/services/announce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,15 +389,11 @@ mod tests {
let remote_client_ip = IpAddr::V4(Ipv4Addr::new(126, 0, 0, 1));

let server_service_binding_clone = server_service_binding.clone();
let peer_copy = peer;

let mut http_stats_event_sender_mock = MockHttpStatsEventSender::new();
http_stats_event_sender_mock
.expect_send()
.with(predicate::function(move |event| {
let mut announced_peer = peer_copy;
announced_peer.peer_addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(126, 0, 0, 1)), 8080);

let mut announcement = peer;
announcement.peer_addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(126, 0, 0, 1)), 8080);

Expand Down Expand Up @@ -462,15 +458,11 @@ mod tests {
let remote_client_ip = IpAddr::V4(Ipv4Addr::LOCALHOST);

let server_service_binding_clone = server_service_binding.clone();
let peer_copy = peer;

let mut http_stats_event_sender_mock = MockHttpStatsEventSender::new();
http_stats_event_sender_mock
.expect_send()
.with(predicate::function(move |event| {
let mut announced_peer = peer_copy;
announced_peer.peer_addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), 8080);

let mut peer_announcement = peer;
peer_announcement.peer_addr = SocketAddr::new(
IpAddr::V6(Ipv6Addr::new(0x6969, 0x6969, 0x6969, 0x6969, 0x6969, 0x6969, 0x6969, 0x6969)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ mod tests {
swarm.upsert_peer(peer.into()).await;

// Remove peers not updated since one second before inserting the peer.
swarm.remove_inactive(last_update_time - one_second).await;
swarm.remove_inactive(last_update_time.checked_sub(one_second).unwrap()).await;

assert_eq!(swarm.len(), 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ mod tests {
peer_list.upsert(peer.into());

// Remove peers not updated since one second before inserting the peer.
peer_list.remove_inactive_peers(last_update_time - one_second);
peer_list.remove_inactive_peers(last_update_time.checked_sub(one_second).unwrap());

assert_eq!(peer_list.len(), 1);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/tracker-core/src/torrent/services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pub async fn get_torrent_info(

let peers = torrent_entry.lock().await.peers(None);

let peers = Some(peers.iter().map(|peer| (**peer)).collect());
let peers = Some(peers.iter().map(|peer| **peer).collect());

Some(Info {
info_hash: *info_hash,
Expand Down
2 changes: 1 addition & 1 deletion packages/udp-tracker-server/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl From<Error> for ErrorKind {
},
UdpScrapeError::TrackerCoreWhitelistError { source } => Self::Whitelist(source.to_string()),
},
Error::Internal { location: _, message } => Self::InternalServer(message.to_string()),
Error::Internal { location: _, message } => Self::InternalServer(message.clone()),
Error::AuthRequired { location } => Self::TrackerAuthentication(location.to_string()),
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/udp-tracker-server/tests/server/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ mod receiving_an_announce_request {
let transaction_id = tx_id.0.to_string();

assert!(
logs_contains_a_line_with(&["ERROR", "UDP TRACKER", &transaction_id.to_string()]),
logs_contains_a_line_with(&["ERROR", "UDP TRACKER", &transaction_id]),
"Expected logs to contain: ERROR ... UDP TRACKER ... transaction_id={transaction_id}"
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/console/ci/e2e/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl Docker {
let mut port_args: Vec<String> = vec![];
for port in &options.ports {
port_args.push("--publish".to_string());
port_args.push(port.to_string());
port_args.push(port.clone());
}

let args = [initial_args, env_var_args, port_args, [image.to_string()].to_vec()].concat();
Expand Down
2 changes: 1 addition & 1 deletion src/console/ci/e2e/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub fn run() -> anyhow::Result<()> {
// Besides, if we don't use port 0 we should get the port numbers from the tracker configuration.
// We could not use docker, but the intention was to create E2E tests including containerization.
let options = RunOptions {
env_vars: vec![("TORRUST_TRACKER_CONFIG_TOML".to_string(), tracker_config.to_string())],
env_vars: vec![("TORRUST_TRACKER_CONFIG_TOML".to_string(), tracker_config.clone())],
ports: vec![
"6969:6969/udp".to_string(),
"7070:7070/tcp".to_string(),
Expand Down
Loading