mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic_http: AnnounceRequest.compact: default to true
This commit is contained in:
parent
ff4fcc163d
commit
1eaf2a0351
2 changed files with 8 additions and 3 deletions
1
TODO.md
1
TODO.md
|
|
@ -16,7 +16,6 @@
|
||||||
* move stuff to common crate with ws: what about Request/InMessage etc?
|
* move stuff to common crate with ws: what about Request/InMessage etc?
|
||||||
* info hashes, peer ids: check that whole deserialization and url decoding
|
* info hashes, peer ids: check that whole deserialization and url decoding
|
||||||
works as it should. There are suspicously many `\u{fffd}`
|
works as it should. There are suspicously many `\u{fffd}`
|
||||||
* AnnounceRequest.compact: handle that it is optional
|
|
||||||
|
|
||||||
## aquatic_ws
|
## aquatic_ws
|
||||||
* tests
|
* tests
|
||||||
|
|
|
||||||
|
|
@ -74,15 +74,21 @@ pub struct AnnounceRequest {
|
||||||
pub bytes_left: usize,
|
pub bytes_left: usize,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub event: AnnounceEvent,
|
pub event: AnnounceEvent,
|
||||||
/// FIXME: is optional, so should default to something, maybe `true`
|
|
||||||
#[serde(
|
#[serde(
|
||||||
deserialize_with = "deserialize_bool_from_number"
|
deserialize_with = "deserialize_bool_from_number",
|
||||||
|
default = "AnnounceRequest::default_compact_value"
|
||||||
)]
|
)]
|
||||||
pub compact: bool,
|
pub compact: bool,
|
||||||
/// Requested number of peers to return
|
/// Requested number of peers to return
|
||||||
pub numwant: usize,
|
pub numwant: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl AnnounceRequest {
|
||||||
|
fn default_compact_value() -> bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize)]
|
#[derive(Debug, Clone, Serialize)]
|
||||||
pub struct AnnounceResponseSuccess {
|
pub struct AnnounceResponseSuccess {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue