Skip to content

Commit

Permalink
dev: cleanup http responses: announce
Browse files Browse the repository at this point in the history
  • Loading branch information
da2ce7 committed Jan 3, 2024
1 parent a12fdee commit f667eac
Show file tree
Hide file tree
Showing 4 changed files with 259 additions and 278 deletions.
2 changes: 1 addition & 1 deletion src/servers/http/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
//! 000000f0: 65 e
//! ```
//!
//! Refer to the [`NonCompact`](crate::servers::http::v1::responses::announce::NonCompact)
//! Refer to the [`Normal`](crate::servers::http::v1::responses::announce::Normal), i.e. `Non-Compact`
//! response for more information about the response.
//!
//! **Sample compact response**
Expand Down
4 changes: 2 additions & 2 deletions src/servers/http/v1/handlers/announce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ fn build_response(announce_request: &Announce, announce_data: AnnounceData) -> R
match &announce_request.compact {
Some(compact) => match compact {
Compact::Accepted => announce::Compact::from(announce_data).into_response(),
Compact::NotAccepted => announce::NonCompact::from(announce_data).into_response(),
Compact::NotAccepted => announce::Normal::from(announce_data).into_response(),
},
// Default response format non compact
None => announce::NonCompact::from(announce_data).into_response(),
None => announce::Normal::from(announce_data).into_response(),
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/servers/http/v1/requests/announce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ impl fmt::Display for Event {
/// Depending on the value of this param, the tracker will return a different
/// response:
///
/// - [`NonCompact`](crate::servers::http::v1::responses::announce::NonCompact) response.
/// - [`Normal`](crate::servers::http::v1::responses::announce::Normal), i.e. a `non-compact` response.
/// - [`Compact`](crate::servers::http::v1::responses::announce::Compact) response.
///
/// Refer to [BEP 23. Tracker Returns Compact Peer Lists](https://www.bittorrent.org/beps/bep_0023.html)
Expand Down
Loading

0 comments on commit f667eac

Please sign in to comment.