diff --git a/packages/configuration/src/lib.rs b/packages/configuration/src/lib.rs index 1ab3479fa..7e384297d 100644 --- a/packages/configuration/src/lib.rs +++ b/packages/configuration/src/lib.rs @@ -3,7 +3,7 @@ //! This module contains the configuration data structures for the //! Torrust Tracker, which is a `BitTorrent` tracker server. //! -//! The current version for configuration is [`v2`]. +//! The current version for configuration is [`v2_0_0`]. pub mod v2_0_0; pub mod validator; diff --git a/packages/configuration/src/v2_0_0/mod.rs b/packages/configuration/src/v2_0_0/mod.rs index 5067210bb..fd742d8d2 100644 --- a/packages/configuration/src/v2_0_0/mod.rs +++ b/packages/configuration/src/v2_0_0/mod.rs @@ -39,11 +39,11 @@ //! Please refer to the documentation of each structure for more information //! about each section. //! -//! - [`Core configuration`](crate::v2::Configuration) -//! - [`HTTP API configuration`](crate::v2::tracker_api::HttpApi) -//! - [`HTTP Tracker configuration`](crate::v2::http_tracker::HttpTracker) -//! - [`UDP Tracker configuration`](crate::v2::udp_tracker::UdpTracker) -//! - [`Health Check API configuration`](crate::v2::health_check_api::HealthCheckApi) +//! - [`Core configuration`](crate::v2_0_0::Configuration) +//! - [`HTTP API configuration`](crate::v2_0_0::tracker_api::HttpApi) +//! - [`HTTP Tracker configuration`](crate::v2_0_0::http_tracker::HttpTracker) +//! - [`UDP Tracker configuration`](crate::v2_0_0::udp_tracker::UdpTracker) +//! - [`Health Check API configuration`](crate::v2_0_0::health_check_api::HealthCheckApi) //! //! ## Port binding //! @@ -78,7 +78,7 @@ //! //! Alternatively, you could setup a reverse proxy like Nginx or Apache to //! handle the SSL/TLS part and forward the requests to the tracker. If you do -//! that, you should set [`on_reverse_proxy`](crate::v2::network::Network::on_reverse_proxy) +//! that, you should set [`on_reverse_proxy`](crate::v2_0_0::network::Network::on_reverse_proxy) //! to `true` in the configuration file. It's out of scope for this //! documentation to explain in detail how to setup a reverse proxy, but the //! configuration file should be something like this: diff --git a/packages/http-protocol/src/v1/requests/announce.rs b/packages/http-protocol/src/v1/requests/announce.rs index ea76771dd..9bde7ec13 100644 --- a/packages/http-protocol/src/v1/requests/announce.rs +++ b/packages/http-protocol/src/v1/requests/announce.rs @@ -185,8 +185,8 @@ impl fmt::Display for Event { /// Depending on the value of this param, the tracker will return a different /// response: /// -/// - [`Normal`](crate::servers::http::v1::responses::announce::Normal), i.e. a `non-compact` response. -/// - [`Compact`](crate::servers::http::v1::responses::announce::Compact) response. +/// - [`Normal`](crate::v1::responses::announce::Normal), i.e. a `non-compact` response. +/// - [`Compact`](crate::v1::responses::announce::Compact) response. /// /// Refer to [BEP 23. Tracker Returns Compact Peer Lists](https://www.bittorrent.org/beps/bep_0023.html) #[derive(PartialEq, Debug)] diff --git a/packages/http-protocol/src/v1/requests/mod.rs b/packages/http-protocol/src/v1/requests/mod.rs index ee34ca72a..d19bd78d3 100644 --- a/packages/http-protocol/src/v1/requests/mod.rs +++ b/packages/http-protocol/src/v1/requests/mod.rs @@ -1,6 +1,3 @@ //! HTTP requests for the HTTP tracker. -//! -//! Refer to the generic [HTTP server documentation](crate::servers::http) for -//! more information about the HTTP tracker. pub mod announce; pub mod scrape; diff --git a/packages/http-protocol/src/v1/responses/announce.rs b/packages/http-protocol/src/v1/responses/announce.rs index 3854c9f34..df187fdd1 100644 --- a/packages/http-protocol/src/v1/responses/announce.rs +++ b/packages/http-protocol/src/v1/responses/announce.rs @@ -1,4 +1,4 @@ -//! `Announce` response for the HTTP tracker [`announce`](bittorrent_http_protocol::v1::requests::announce::Announce) request. +//! `Announce` response for the HTTP tracker [`announce`](crate::v1::requests::announce::Announce) request. //! //! Data structures and logic to build the `announce` response. use std::io::Write; diff --git a/packages/http-protocol/src/v1/responses/error.rs b/packages/http-protocol/src/v1/responses/error.rs index 7516cd39e..f939ce298 100644 --- a/packages/http-protocol/src/v1/responses/error.rs +++ b/packages/http-protocol/src/v1/responses/error.rs @@ -1,4 +1,4 @@ -//! `Error` response for the [`HTTP tracker`](crate::servers::http). +//! `Error` response for the HTTP tracker. //! //! Data structures and logic to build the error responses. //! @@ -15,7 +15,7 @@ use serde::Serialize; use crate::v1::services::peer_ip_resolver::PeerIpResolutionError; -/// `Error` response for the [`HTTP tracker`](crate::servers::http). +/// `Error` response for the HTTP tracker. #[derive(Serialize, Debug, PartialEq)] pub struct Error { /// Human readable string which explains why the request failed. diff --git a/packages/http-protocol/src/v1/responses/mod.rs b/packages/http-protocol/src/v1/responses/mod.rs index 495b1eb84..e704d8908 100644 --- a/packages/http-protocol/src/v1/responses/mod.rs +++ b/packages/http-protocol/src/v1/responses/mod.rs @@ -1,7 +1,4 @@ //! HTTP responses for the HTTP tracker. -//! -//! Refer to the generic [HTTP server documentation](crate::servers::http) for -//! more information about the HTTP tracker. pub mod announce; pub mod error; pub mod scrape; diff --git a/packages/http-protocol/src/v1/responses/scrape.rs b/packages/http-protocol/src/v1/responses/scrape.rs index ee4c4155b..6b4dcc793 100644 --- a/packages/http-protocol/src/v1/responses/scrape.rs +++ b/packages/http-protocol/src/v1/responses/scrape.rs @@ -1,4 +1,4 @@ -//! `Scrape` response for the HTTP tracker [`scrape`](bittorrent_http_protocol::v1::requests::scrape::Scrape) request. +//! `Scrape` response for the HTTP tracker [`scrape`](crate::v1::requests::scrape::Scrape) request. //! //! Data structures and logic to build the `scrape` response. use std::borrow::Cow; diff --git a/src/core/mod.rs b/src/core/mod.rs index ae728dc12..d30c47c6d 100644 --- a/src/core/mod.rs +++ b/src/core/mod.rs @@ -52,7 +52,7 @@ //! The tracker responds to the peer with the list of other peers in the swarm so that //! the peer can contact them to start downloading pieces of the file from them. //! -//! Once you have instantiated the `Tracker` you can `announce` a new [`peer::Peer`] with: +//! Once you have instantiated the `AnnounceHandler` you can `announce` a new [`peer::Peer`](torrust_tracker_primitives::peer::Peer) with: //! //! ```rust,no_run //! use std::net::SocketAddr; @@ -81,7 +81,7 @@ //! ``` //! //! ```text -//! let announce_data = tracker.announce(&info_hash, &mut peer, &peer_ip).await; +//! let announce_data = announce_handler.announce(&info_hash, &mut peer, &peer_ip).await; //! ``` //! //! The `Tracker` returns the list of peers for the torrent with the infohash `3b245504cf5f11bbdbe1201cea6a6bf45aee1bc0`, @@ -306,7 +306,7 @@ //! `c1277613db1d28709b034a017ab2cae4be07ae10` is the torrent infohash and `completed` contains the number of peers //! that have a full version of the torrent data, also known as seeders. //! -//! Refer to [`peer`] module for more information about peers. +//! Refer to [`peer`](torrust_tracker_primitives::peer) for more information about peers. //! //! # Configuration //! diff --git a/src/servers/http/v1/services/announce.rs b/src/servers/http/v1/services/announce.rs index 2c88ebc60..1923037b3 100644 --- a/src/servers/http/v1/services/announce.rs +++ b/src/servers/http/v1/services/announce.rs @@ -2,9 +2,8 @@ //! //! The service is responsible for handling the `announce` requests. //! -//! It delegates the `announce` logic to the [`Tracker`](crate::core::Tracker::announce) -//! and it returns the [`AnnounceData`] returned -//! by the [`Tracker`]. +//! It delegates the `announce` logic to the [`AnnounceHandler`] and it returns +//! the [`AnnounceData`]. //! //! It also sends an [`statistics::event::Event`] //! because events are specific for the HTTP tracker.