Merge pull request #374 from av-gal/main
Include crate version in client fingerprint portion of `peer_id`
This commit is contained in:
commit
3fa55bdc14
13 changed files with 170 additions and 24 deletions
|
|
@ -52,7 +52,7 @@ home = { version = "=0.5.5", optional = true }
|
|||
bencode = { path = "../bencode", default-features = false, package = "librqbit-bencode", version = "3" }
|
||||
tracker_comms = { path = "../tracker_comms", default-features = false, package = "librqbit-tracker-comms", version = "2.1" }
|
||||
buffers = { path = "../buffers", package = "librqbit-buffers", version = "4.2" }
|
||||
librqbit-core = { path = "../librqbit_core", default-features = false, version = "4.1" }
|
||||
librqbit-core = { path = "../librqbit_core", default-features = false, version = "5" }
|
||||
clone_to_owned = { path = "../clone_to_owned", package = "librqbit-clone-to-owned", version = "3" }
|
||||
peer_binary_protocol = { path = "../peer_binary_protocol", default-features = false, package = "librqbit-peer-protocol", version = "4.2" }
|
||||
sha1w = { path = "../sha1w", default-features = false, package = "librqbit-sha1-wrapper", version = "4.1" }
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ mod tests {
|
|||
let dht = DhtBuilder::new().await.unwrap();
|
||||
|
||||
let peer_rx = dht.get_peers(info_hash, None);
|
||||
let peer_id = generate_peer_id();
|
||||
let peer_id = generate_peer_id(b"-xx1234-");
|
||||
match read_metainfo_from_peer_receiver(
|
||||
peer_id,
|
||||
info_hash,
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ mod tests {
|
|||
init_logging();
|
||||
|
||||
let addr = SocketAddr::from_str("127.0.0.1:27311").unwrap();
|
||||
let peer_id = generate_peer_id();
|
||||
let peer_id = generate_peer_id(b"-xx1234-");
|
||||
let info_hash = Id20::from_str("9905f844e5d8787ecd5e08fb46b2eb0a42c131d7").unwrap();
|
||||
dbg!(read_metainfo_from_peer(
|
||||
addr,
|
||||
|
|
|
|||
|
|
@ -46,9 +46,10 @@ use futures::{
|
|||
use itertools::Itertools;
|
||||
use librqbit_core::{
|
||||
constants::CHUNK_SIZE,
|
||||
crate_version,
|
||||
directories::get_configuration_directory,
|
||||
magnet::Magnet,
|
||||
peer_id::generate_peer_id,
|
||||
peer_id::generate_azereus_style,
|
||||
spawn_utils::spawn_with_cancel,
|
||||
torrent_metainfo::{TorrentMetaV1Info, TorrentMetaV1Owned},
|
||||
};
|
||||
|
|
@ -498,7 +499,9 @@ impl Session {
|
|||
mut opts: SessionOptions,
|
||||
) -> BoxFuture<'static, anyhow::Result<Arc<Self>>> {
|
||||
async move {
|
||||
let peer_id = opts.peer_id.unwrap_or_else(generate_peer_id);
|
||||
let peer_id = opts
|
||||
.peer_id
|
||||
.unwrap_or_else(|| generate_azereus_style(*b"rQ", crate_version!()));
|
||||
let token = opts.cancellation_token.take().unwrap_or_default();
|
||||
|
||||
#[cfg(feature = "disable-upload")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue