mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 10:45:30 +00:00
aquatic_ws: announce handler fixes, related changes elsewhere
This commit is contained in:
parent
7ebbb311e1
commit
a39c7a5950
3 changed files with 55 additions and 8 deletions
|
|
@ -3,19 +3,19 @@ use serde::{Serialize, Deserialize};
|
|||
|
||||
|
||||
/// FIXME: This is really just string with 20 length
|
||||
#[derive(Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Clone, Copy, Hash, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(transparent)]
|
||||
pub struct PeerId(pub [u8; 20]);
|
||||
|
||||
|
||||
/// FIXME: This is really just string with 20 length
|
||||
#[derive(Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Clone, Copy, Hash, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(transparent)]
|
||||
pub struct InfoHash(pub [u8; 20]);
|
||||
|
||||
|
||||
/// FIXME: This is really just string with 20 length
|
||||
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(transparent)]
|
||||
pub struct OfferId(pub [u8; 20]);
|
||||
|
||||
|
|
@ -107,8 +107,10 @@ pub struct AnnounceRequest {
|
|||
/// I think using Option is good, it seems like this isn't always set
|
||||
/// (same as `offers`)
|
||||
pub answer: Option<JsonValue>,
|
||||
/// Only parsed to hex if answer == true, probably undefined otherwise
|
||||
/// Likely undefined if !(answer == true)
|
||||
pub to_peer_id: Option<PeerId>,
|
||||
/// Sent if answer is set
|
||||
pub offer_id: Option<OfferId>,
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue