This commit is contained in:
Igor Katson 2021-07-13 13:16:59 +01:00
parent 951f610cfd
commit 1cd6caee76
6 changed files with 31 additions and 18 deletions

View file

@ -30,7 +30,7 @@ pub struct ExtendedHandshake<ByteBuf: Eq + std::hash::Hash> {
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata_size: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub complete_ago: Option<u32>,
pub complete_ago: Option<i32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub upload_only: Option<u32>,
}

View file

@ -474,8 +474,8 @@ where
pub struct Handshake<'a> {
pub pstr: &'a str,
pub reserved: [u8; 8],
pub info_hash: Id20,
pub peer_id: Id20,
pub info_hash: [u8; 20],
pub peer_id: [u8; 20],
}
fn bopts() -> impl bincode::Options {
@ -497,8 +497,8 @@ impl<'a> Handshake<'a> {
Handshake {
pstr: PSTR_BT1,
reserved: reserved_arr,
info_hash,
peer_id,
info_hash: info_hash.0,
peer_id: peer_id.0,
}
}
pub fn supports_extended(&self) -> bool {