Decode more peer ids
This commit is contained in:
parent
d7f3d883f2
commit
0bb1c77456
2 changed files with 8 additions and 2 deletions
|
|
@ -200,7 +200,7 @@ impl<H: PeerConnectionHandler> PeerConnection<H> {
|
|||
.context("error reading handshake")?;
|
||||
let h_supports_extended = h.supports_extended();
|
||||
trace!(
|
||||
peer_id=?h.peer_id,
|
||||
peer_id=?Id20::new(h.peer_id),
|
||||
decoded_id=?try_decode_peer_id(Id20::new(h.peer_id)),
|
||||
"connected",
|
||||
);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ pub enum AzureusStyleKind {
|
|||
Deluge,
|
||||
LibTorrent,
|
||||
Transmission,
|
||||
QBittorrent,
|
||||
UTorrent,
|
||||
RQBit,
|
||||
Other([char; 2]),
|
||||
}
|
||||
|
||||
|
|
@ -20,6 +23,9 @@ impl AzureusStyleKind {
|
|||
b"DE" => AzureusStyleKind::Deluge,
|
||||
b"lt" | b"LT" => AzureusStyleKind::LibTorrent,
|
||||
b"TR" => AzureusStyleKind::Transmission,
|
||||
b"qB" => AzureusStyleKind::QBittorrent,
|
||||
b"UT" => AzureusStyleKind::UTorrent,
|
||||
b"rQ" => AzureusStyleKind::RQBit,
|
||||
_ => AzureusStyleKind::Other([b1 as char, b2 as char]),
|
||||
}
|
||||
}
|
||||
|
|
@ -53,7 +59,7 @@ pub fn generate_peer_id() -> Id20 {
|
|||
let u = uuid::Uuid::new_v4();
|
||||
peer_id[4..20].copy_from_slice(&u.as_bytes()[..]);
|
||||
|
||||
peer_id[..8].copy_from_slice(b"-rQ0001-");
|
||||
peer_id[..8].copy_from_slice(b"-rQ7000-");
|
||||
|
||||
Id20::new(peer_id)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue