Compile times are even worse now
This commit is contained in:
parent
18f22cf323
commit
15c078619c
11 changed files with 72 additions and 22 deletions
|
|
@ -23,6 +23,7 @@ rust-tls = ["reqwest/rustls-tls"]
|
|||
|
||||
[dependencies]
|
||||
bencode = {path = "../bencode", default-features=false, package="librqbit-bencode", version="2.2.1"}
|
||||
tracker_comms = {path = "../tracker_comms", default-features=false, package="librqbit-tracker-comms", version="1.0.0"}
|
||||
buffers = {path = "../buffers", package="librqbit-buffers", version = "2.2.1"}
|
||||
librqbit-core = {path = "../librqbit_core", version = "3.5.0"}
|
||||
clone_to_owned = {path = "../clone_to_owned", package="librqbit-clone-to-owned", version = "2.2.1"}
|
||||
|
|
|
|||
|
|
@ -36,9 +36,6 @@ mod session;
|
|||
mod spawn_utils;
|
||||
mod torrent_state;
|
||||
pub mod tracing_subscriber_config_utils;
|
||||
pub mod tracker_comms;
|
||||
pub mod tracker_comms_http;
|
||||
pub mod tracker_comms_udp;
|
||||
mod type_aliases;
|
||||
|
||||
pub use api::Api;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,16 @@ use std::{
|
|||
time::Duration,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
dht_utils::{read_metainfo_from_peer_receiver, ReadMetainfoResult},
|
||||
peer_connection::PeerConnectionOptions,
|
||||
read_buf::ReadBuf,
|
||||
spawn_utils::BlockingSpawner,
|
||||
torrent_state::{
|
||||
ManagedTorrentBuilder, ManagedTorrentHandle, ManagedTorrentState, TorrentStateLive,
|
||||
},
|
||||
type_aliases::PeerStream,
|
||||
};
|
||||
use anyhow::{bail, Context};
|
||||
use bencode::{bencode_serialize_to_writer, BencodeDeserializer};
|
||||
use buffers::{ByteBuf, ByteBufT, ByteString};
|
||||
|
|
@ -32,18 +42,7 @@ use tokio::net::{TcpListener, TcpStream};
|
|||
use tokio_stream::StreamExt;
|
||||
use tokio_util::sync::{CancellationToken, DropGuard};
|
||||
use tracing::{debug, error, error_span, info, trace, warn, Instrument};
|
||||
|
||||
use crate::{
|
||||
dht_utils::{read_metainfo_from_peer_receiver, ReadMetainfoResult},
|
||||
peer_connection::PeerConnectionOptions,
|
||||
read_buf::ReadBuf,
|
||||
spawn_utils::BlockingSpawner,
|
||||
torrent_state::{
|
||||
ManagedTorrentBuilder, ManagedTorrentHandle, ManagedTorrentState, TorrentStateLive,
|
||||
},
|
||||
tracker_comms::TrackerComms,
|
||||
type_aliases::PeerStream,
|
||||
};
|
||||
use tracker_comms::TrackerComms;
|
||||
|
||||
pub const SUPPORTED_SCHEMES: [&str; 3] = ["http:", "https:", "magnet:"];
|
||||
|
||||
|
|
|
|||
27
crates/tracker_comms/Cargo.toml
Normal file
27
crates/tracker_comms/Cargo.toml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
[package]
|
||||
name = "librqbit-tracker-comms"
|
||||
version = "1.0.0"
|
||||
edition = "2018"
|
||||
description = "Common interface around various sha1 implementations used in rqbit torrent client."
|
||||
license = "Apache-2.0"
|
||||
documentation = "https://docs.rs/librqbit-tracker-comms"
|
||||
repository = "https://github.com/ikatson/rqbit"
|
||||
readme = "README.md"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
tokio = "1"
|
||||
anyhow = "1"
|
||||
futures = "0.3"
|
||||
async-stream = "0.3.5"
|
||||
buffers = {path = "../buffers", package="librqbit-buffers", version = "2.2.1"}
|
||||
librqbit-core = {path = "../librqbit_core", version = "3.5.0"}
|
||||
byteorder = "1.5"
|
||||
serde = {version = "1", features=["derive"]}
|
||||
urlencoding = "2"
|
||||
rand = "0.8"
|
||||
tracing = "0.1.40"
|
||||
reqwest = {version="0.11.22", default-features=false, features = ["json"]}
|
||||
bencode = {path = "../bencode", default-features=false, package="librqbit-bencode", version="2.2.1"}
|
||||
url = "2"
|
||||
Binary file not shown.
5
crates/tracker_comms/src/lib.rs
Normal file
5
crates/tracker_comms/src/lib.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
mod tracker_comms;
|
||||
mod tracker_comms_http;
|
||||
mod tracker_comms_udp;
|
||||
|
||||
pub use tracker_comms::*;
|
||||
|
|
@ -12,9 +12,9 @@ const ACTION_ANNOUNCE: u32 = 1;
|
|||
// const ACTION_ERROR: u32 = 3;
|
||||
|
||||
pub const EVENT_NONE: u32 = 0;
|
||||
pub const EVENT_COMPLETED: u32 = 1;
|
||||
pub const EVENT_STARTED: u32 = 2;
|
||||
pub const EVENT_STOPPED: u32 = 3;
|
||||
// pub const EVENT_COMPLETED: u32 = 1;
|
||||
// pub const EVENT_STARTED: u32 = 2;
|
||||
// pub const EVENT_STOPPED: u32 = 3;
|
||||
|
||||
pub type ConnectionId = u64;
|
||||
const CONNECTION_ID_MAGIC: ConnectionId = 0x41727101980;
|
||||
|
|
@ -293,7 +293,7 @@ mod tests {
|
|||
Response::Connect(connection_id) => {
|
||||
dbg!(connection_id)
|
||||
}
|
||||
other => panic!("unexpected response {other:?}"),
|
||||
other => panic!("unexpected response {:?}", other),
|
||||
};
|
||||
|
||||
let hash = Id20::from_str("775459190aa65566591634203f8d9f17d341f969").unwrap();
|
||||
|
|
@ -335,7 +335,7 @@ mod tests {
|
|||
Response::Announce(r) => {
|
||||
dbg!(r);
|
||||
}
|
||||
other => panic!("unexpected response {other:?}"),
|
||||
other => panic!("unexpected response {:?}", other),
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue