Skip to content

Commit 129fd2f

Browse files
committed
refactor: move upd tracker client
to follow same folder strucutre as the HTTP tracker client.
1 parent 470e608 commit 129fd2f

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

src/servers/health_check_api/handlers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use torrust_tracker_configuration::{Configuration, HttpApi, HttpTracker, UdpTrac
88

99
use super::resources::Report;
1010
use super::responses;
11-
use crate::shared::bit_torrent::udp::client::new_udp_tracker_client_connected;
11+
use crate::shared::bit_torrent::tracker::udp::client::new_udp_tracker_client_connected;
1212

1313
/// If port 0 is specified in the configuration the OS will automatically
1414
/// assign a free port. But we do now know in from the configuration.

src/servers/udp/server.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use crate::bootstrap::jobs::Started;
3434
use crate::core::Tracker;
3535
use crate::servers::signals::{shutdown_signal_with_message, Halted};
3636
use crate::servers::udp::handlers::handle_packet;
37-
use crate::shared::bit_torrent::udp::MAX_PACKET_SIZE;
37+
use crate::shared::bit_torrent::tracker::udp::MAX_PACKET_SIZE;
3838

3939
/// Error that can occur when starting or stopping the UDP server.
4040
///

src/shared/bit_torrent/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,3 @@
7070
pub mod common;
7171
pub mod info_hash;
7272
pub mod tracker;
73-
pub mod udp;

src/shared/bit_torrent/tracker/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
pub mod http;
2+
pub mod udp;

src/shared/bit_torrent/udp/client.rs src/shared/bit_torrent/tracker/udp/client.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::sync::Arc;
44
use aquatic_udp_protocol::{Request, Response};
55
use tokio::net::UdpSocket;
66

7-
use crate::shared::bit_torrent::udp::{source_address, MAX_PACKET_SIZE};
7+
use crate::shared::bit_torrent::tracker::udp::{source_address, MAX_PACKET_SIZE};
88

99
#[allow(clippy::module_name_repetitions)]
1010
pub struct UdpClient {
File renamed without changes.

tests/servers/udp/contract.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
use core::panic;
77

88
use aquatic_udp_protocol::{ConnectRequest, ConnectionId, Response, TransactionId};
9-
use torrust_tracker::shared::bit_torrent::udp::client::{new_udp_client_connected, UdpTrackerClient};
10-
use torrust_tracker::shared::bit_torrent::udp::MAX_PACKET_SIZE;
9+
use torrust_tracker::shared::bit_torrent::tracker::udp::client::{new_udp_client_connected, UdpTrackerClient};
10+
use torrust_tracker::shared::bit_torrent::tracker::udp::MAX_PACKET_SIZE;
1111
use torrust_tracker_test_helpers::configuration;
1212

1313
use crate::servers::udp::asserts::is_error_response;
@@ -51,7 +51,7 @@ async fn should_return_a_bad_request_response_when_the_client_sends_an_empty_req
5151

5252
mod receiving_a_connection_request {
5353
use aquatic_udp_protocol::{ConnectRequest, TransactionId};
54-
use torrust_tracker::shared::bit_torrent::udp::client::new_udp_tracker_client_connected;
54+
use torrust_tracker::shared::bit_torrent::tracker::udp::client::new_udp_tracker_client_connected;
5555
use torrust_tracker_test_helpers::configuration;
5656

5757
use crate::servers::udp::asserts::is_connect_response;
@@ -82,7 +82,7 @@ mod receiving_an_announce_request {
8282
AnnounceEvent, AnnounceRequest, ConnectionId, InfoHash, NumberOfBytes, NumberOfPeers, PeerId, PeerKey, Port,
8383
TransactionId,
8484
};
85-
use torrust_tracker::shared::bit_torrent::udp::client::new_udp_tracker_client_connected;
85+
use torrust_tracker::shared::bit_torrent::tracker::udp::client::new_udp_tracker_client_connected;
8686
use torrust_tracker_test_helpers::configuration;
8787

8888
use crate::servers::udp::asserts::is_ipv4_announce_response;
@@ -124,7 +124,7 @@ mod receiving_an_announce_request {
124124

125125
mod receiving_an_scrape_request {
126126
use aquatic_udp_protocol::{ConnectionId, InfoHash, ScrapeRequest, TransactionId};
127-
use torrust_tracker::shared::bit_torrent::udp::client::new_udp_tracker_client_connected;
127+
use torrust_tracker::shared::bit_torrent::tracker::udp::client::new_udp_tracker_client_connected;
128128
use torrust_tracker_test_helpers::configuration;
129129

130130
use crate::servers::udp::asserts::is_scrape_response;

0 commit comments

Comments
 (0)