Merge pull request #376 from ikatson/prepare-8.1.0

Prepare for releasing 8.1.0
This commit is contained in:
Igor Katson 2025-06-05 11:58:20 +01:00 committed by GitHub
commit 559fca8552
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 2113 additions and 1624 deletions

View file

@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
rust_version: ["1.78", "1.83"]
rust_version: ["1.85", "1.87"]
steps:
- name: rustup toolchain install ${{ matrix.rust_version }}
run: |
@ -45,7 +45,7 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
prefix-key: v1
- name: Run tests
if: ${{ matrix.os == 'windows-latest' }}
run: cargo test --workspace
@ -53,7 +53,7 @@ jobs:
- name: Run tests
if: ${{ matrix.os == 'macos-latest' }}
run: ulimit -n unlimited && cargo test --workspace
- name: Run tests
if: ${{ matrix.os == 'ubuntu-latest' }}
run: cargo test

2304
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
[package]
name = "librqbit-bencode"
version = "3.0.2"
version = "3.1.0"
edition = "2021"
description = "Bencode serialization and deserialization using Serde"
license = "Apache-2.0"

View file

@ -1,6 +1,6 @@
[package]
name = "librqbit-clone-to-owned"
version = "3.0.0"
version = "3.0.1"
edition = "2021"
description = "Util traits to represent something that can be made owned and change type at the same time."
license = "Apache-2.0"
@ -10,4 +10,4 @@ readme = "README.md"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bytes = "1.7.1"
bytes = "1.10"

View file

@ -1,6 +1,6 @@
[package]
name = "librqbit-dht"
version = "5.2.0"
version = "5.3.0"
edition = "2021"
description = "DHT implementation, used in rqbit torrent client."
license = "Apache-2.0"
@ -28,13 +28,13 @@ serde = { version = "1", features = ["derive"] }
leaky-bucket = "1.1"
serde_json = "1"
hex = "0.4"
bencode = { path = "../bencode", default-features = false, package = "librqbit-bencode", version = "3" }
bencode = { path = "../bencode", default-features = false, package = "librqbit-bencode", version = "3.1" }
anyhow = "1"
parking_lot = "0.12"
tracing = "0.1"
backoff = "0.4.0"
futures = "0.3"
rand = "0.8"
rand = "0.9"
indexmap = "2"
dashmap = { version = "6", features = ["serde"] }
clone_to_owned = { path = "../clone_to_owned", package = "librqbit-clone-to-owned", version = "3" }

View file

@ -121,7 +121,7 @@ impl PeerStore {
pub fn gen_token_for(&self, node_id: Id20, addr: SocketAddr) -> [u8; 4] {
let mut token = [0u8; 4];
rand::thread_rng().fill_bytes(&mut token);
rand::rng().fill_bytes(&mut token);
let mut tokens = self.tokens.write();
tokens.push_back(StoredToken {
token,

View file

@ -131,7 +131,7 @@ impl<'a> Iterator for BucketTreeIterator<'a> {
pub fn generate_random_id(start: &Id20, bits: u8) -> Id20 {
let mut data = [0u8; 20];
rand::thread_rng().fill_bytes(&mut data);
rand::rng().fill_bytes(&mut data);
let mut data = Id20::new(data);
let remaining_bits = 160 - bits;
for bit in 0..remaining_bits {
@ -649,13 +649,13 @@ mod tests {
fn random_id_20() -> Id20 {
let mut id20 = [0u8; 20];
rand::thread_rng().fill(&mut id20);
rand::rng().fill(&mut id20);
Id20::new(id20)
}
fn generate_socket_addr() -> SocketAddr {
let mut ipv4_addr = [0u8; 6];
rand::thread_rng().fill(&mut ipv4_addr);
rand::rng().fill(&mut ipv4_addr);
let ip = Ipv4Addr::new(ipv4_addr[0], ipv4_addr[1], ipv4_addr[2], ipv4_addr[3]);
let port = ((ipv4_addr[4] as u16) << 8) + (ipv4_addr[5] as u16);
SocketAddrV4::new(ip, port).into()

View file

@ -1,6 +1,6 @@
[package]
name = "librqbit"
version = "8.0.0"
version = "8.1.0"
authors = ["Igor Katson <igor.katson@gmail.com>"]
edition = "2021"
description = "The main library used by rqbit torrent client. The binary is just a small wrapper on top of it."
@ -42,21 +42,21 @@ disable-upload = []
[dependencies]
# sqlx and home are pinned so that we can compile on older Rusts
sqlx = { version = "=0.8.2", features = [
sqlx = { version = "0.8", features = [
"runtime-tokio",
"macros",
"postgres",
], default-features = false, optional = true }
home = { version = "=0.5.5", optional = true }
home = { version = "0.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" }
bencode = { path = "../bencode", default-features = false, package = "librqbit-bencode", version = "3.1" }
tracker_comms = { path = "../tracker_comms", default-features = false, package = "librqbit-tracker-comms", version = "3" }
buffers = { path = "../buffers", package = "librqbit-buffers", version = "4.2" }
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" }
peer_binary_protocol = { path = "../peer_binary_protocol", default-features = false, package = "librqbit-peer-protocol", version = "4.3" }
sha1w = { path = "../sha1w", default-features = false, package = "librqbit-sha1-wrapper", version = "4.1" }
dht = { path = "../dht", package = "librqbit-dht", default-features = false, version = "5.2.0" }
dht = { path = "../dht", package = "librqbit-dht", default-features = false, version = "5.3.0" }
librqbit-upnp = { path = "../upnp", version = "1" }
upnp-serve = { path = "../upnp-serve", package = "librqbit-upnp-serve", default-features = false, version = "1", optional = true }
@ -66,7 +66,7 @@ tokio = { version = "1", features = [
"fs",
"io-util",
] }
governor = "0.8"
governor = "0.10"
console-subscriber = { version = "0.4", optional = true }
axum = { version = "0.8", optional = true }
tower-http = { version = "0.6", features = ["cors", "trace"], optional = true }
@ -85,12 +85,12 @@ reqwest = { version = "0.12", default-features = false, features = [
] }
urlencoding = "2"
byteorder = "1"
bincode = "1"
bincode = "2"
bitvec = "1"
parking_lot = "0.12"
tracing = "0.1.40"
size_format = "1"
rand = "0.8"
rand = "0.9"
tracing-subscriber = { version = "0.3", default-features = false, features = [
"json",
"fmt",
@ -112,12 +112,12 @@ bytes = "1.5.0"
rlimit = "0.10.1"
async-stream = "0.3.5"
memmap2 = { version = "0.9.4" }
lru = { version = "0.12.3", optional = true }
lru = { version = "0.14", optional = true }
mime_guess = { version = "2.0.5", default-features = false }
tokio-socks = "0.5.2"
async-trait = "0.1.81"
async-backtrace = { version = "0.2", optional = true }
notify = { version = "7", optional = true }
notify = { version = "8", optional = true }
walkdir = "2.5.0"
arc-swap = "1.7.1"
intervaltree = "0.2.7"
@ -127,8 +127,6 @@ async-compression = { version = "0.4.18", features = ["tokio", "gzip"] }
anyhow = "1"
[dev-dependencies]
futures = { version = "0.3" }
tracing-subscriber = "0.3"
tokio-test = "0.4"
tempfile = "3"
rand = { version = "0.8", features = ["small_rng"] }

View file

@ -47,11 +47,7 @@ impl Blocklist {
anyhow::bail!("Failed to fetch blocklist: HTTP {}", response.status());
}
let reader = StreamReader::new(
response
.bytes_stream()
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e)),
);
let reader = StreamReader::new(response.bytes_stream().map_err(std::io::Error::other));
Self::create_from_stream(reader).await
}

View file

@ -13,6 +13,7 @@ use crate::{
use librqbit_core::hash_id::Id20;
#[derive(Debug)]
#[allow(clippy::large_enum_variant)]
pub enum ReadMetainfoResult<Rx> {
Found {
info: TorrentMetaV1Info<ByteBufOwned>,

View file

@ -358,17 +358,17 @@ impl<H: PeerConnectionHandler> PeerConnection<H> {
use crate::tests::test_util::TestPeerMetadata;
let tpm = TestPeerMetadata::from_peer_id(self.peer_id);
use rand::Rng;
if rand::thread_rng().gen_bool(tpm.disconnect_probability()) {
if rand::rng().random_bool(tpm.disconnect_probability()) {
bail!("disconnecting, to simulate failure in tests");
}
#[allow(clippy::cast_possible_truncation)]
let sleep_ms = (rand::thread_rng().gen::<f64>()
let sleep_ms = (rand::rng().random::<f64>()
* (tpm.max_random_sleep_ms as f64))
as u64;
tokio::time::sleep(Duration::from_millis(sleep_ms)).await;
if rand::thread_rng().gen_bool(tpm.bad_data_probability()) {
if rand::rng().random_bool(tpm.bad_data_probability()) {
warn!("will NOT actually read the data to simulate a malicious peer that sends garbage");
write_buf.fill(0);
skip_reading_for_e2e_tests = true;

View file

@ -998,11 +998,8 @@ impl Session {
return Ok(None);
}
fn check_valid(pb: &PathBuf) -> anyhow::Result<()> {
if pb.components().into_iter().any(|x| match x {
Component::Normal(_) => false,
_ => true,
}) {
fn check_valid(pb: &Path) -> anyhow::Result<()> {
if pb.components().any(|x| !matches!(x, Component::Normal(_))) {
bail!("path traversal in torrent name detected")
}
Ok(())

View file

@ -87,7 +87,7 @@ async fn _test_e2e_download(drop_checks: &DropChecks) {
async move {
let peer_id = TestPeerMetadata {
server_id: i,
max_random_sleep_ms: rand::thread_rng().gen_range(0u8..16),
max_random_sleep_ms: rand::rng().random_range(0u8..16),
}
.as_peer_id();
let listen_range_start = 15100u16 + i as u16;

View file

@ -8,7 +8,7 @@ use std::{
use anyhow::bail;
use librqbit_core::Id20;
use parking_lot::RwLock;
use rand::{thread_rng, Rng, RngCore, SeedableRng};
use rand::{rng, Rng, RngCore, SeedableRng};
use tempfile::TempDir;
use tracing::{info, trace};
@ -29,7 +29,7 @@ pub fn create_new_file_with_random_content(path: &Path, mut size: usize) {
trace!(?path, "creating temp file");
const BUF_SIZE: usize = 8192 * 16;
let mut rng = rand::rngs::SmallRng::from_entropy();
let mut rng = rand::rngs::SmallRng::from_os_rng();
let mut write_buf = [0; BUF_SIZE];
while size > 0 {
rng.fill_bytes(&mut write_buf[..]);
@ -67,7 +67,7 @@ impl TestPeerMetadata {
pub fn as_peer_id(&self) -> Id20 {
let mut peer_id = Id20::default();
thread_rng().fill(&mut peer_id.0);
rng().fill(&mut peer_id.0);
peer_id.0[0] = self.server_id;
peer_id.0[1] = self.max_random_sleep_ms;
peer_id

View file

@ -127,10 +127,10 @@ impl TorrentStateInitializing {
// For all the remaining pieces we claim we have, validate them with decreasing probability.
let mut queue = queue.iter_ones().collect_vec();
queue.shuffle(&mut rand::thread_rng());
queue.shuffle(&mut rand::rng());
for (tmp_id, piece_id) in queue.into_iter().enumerate() {
let denom: u32 = (tmp_id + 1).min(50).try_into().unwrap();
if rand::thread_rng().gen_ratio(1, denom) {
if rand::rng().random_ratio(1, denom) {
to_validate.set(piece_id, true);
}
}

View file

@ -94,7 +94,7 @@ impl TorrentStreams {
// Shuffle to decrease determinism and make queueing fairer.
use rand::seq::SliceRandom;
all.shuffle(&mut rand::thread_rng());
all.shuffle(&mut rand::rng());
Interleave { all: all.into() }
}

View file

@ -20,14 +20,14 @@ tokio = { version = "1", features = ["rt-multi-thread", "macros", "time"] }
hex = "0.4"
anyhow = "1"
url = { version = "2", default-features = false }
rand = "0.8"
rand = "0.9"
parking_lot = "0.12"
serde = { version = "1", features = ["derive"] }
buffers = { path = "../buffers", package = "librqbit-buffers", version = "4.2" }
bencode = { path = "../bencode", default-features = false, package = "librqbit-bencode", version = "3.0.1" }
bencode = { path = "../bencode", default-features = false, package = "librqbit-bencode", version = "3.1" }
clone_to_owned = { path = "../clone_to_owned", package = "librqbit-clone-to-owned", version = "3" }
itertools = "0.14"
directories = "5"
directories = "6"
tokio-util = "0.7.10"
data-encoding = "2.6.0"
bytes = "1.7.1"

View file

@ -102,7 +102,7 @@ pub fn generate_peer_id(fingerprint: &[u8]) -> Id20 {
let mut peer_id = [0u8; 20];
peer_id[..8].copy_from_slice(fingerprint);
rand::thread_rng().fill_bytes(&mut peer_id[8..]);
rand::rng().fill_bytes(&mut peer_id[8..]);
Id20::new(peer_id)
}

View file

@ -1,6 +1,6 @@
[package]
name = "librqbit-peer-protocol"
version = "4.2.0"
version = "4.3.0"
edition = "2021"
description = "Protocol for working with torrent peers. Used in rqbit torrent client."
license = "Apache-2.0"
@ -22,7 +22,7 @@ serde = { version = "1", features = ["derive"] }
bincode = "1"
byteorder = "1"
buffers = { path = "../buffers", package = "librqbit-buffers", version = "4.2" }
bencode = { path = "../bencode", default-features = false, package = "librqbit-bencode", version = "3" }
bencode = { path = "../bencode", default-features = false, package = "librqbit-bencode", version = "3.1" }
clone_to_owned = { path = "../clone_to_owned", package = "librqbit-clone-to-owned", version = "3" }
librqbit-core = { path = "../librqbit_core", default-features = false, version = "5" }
bitvec = "1"

View file

@ -1,6 +1,6 @@
[package]
name = "rqbit"
version = "8.0.0"
version = "8.1.0"
authors = ["Igor Katson <igor.katson@gmail.com>"]
edition = "2021"
description = "A bittorrent command line client and server."
@ -51,7 +51,7 @@ upnp-serve = { path = "../upnp-serve", default-features = false, version = "1",
libc = "0.2.158"
signal-hook = "0.3.17"
tokio-util = "0.7.11"
gethostname = "0.5.0"
gethostname = "1"
url = "2"
[dev-dependencies]

View file

@ -1,6 +1,6 @@
[package]
name = "librqbit-tracker-comms"
version = "2.1.0"
version = "3.0.0"
edition = "2018"
description = "Common interface around various sha1 implementations used in rqbit torrent client."
license = "Apache-2.0"
@ -27,10 +27,10 @@ librqbit-core = { path = "../librqbit_core", default-features = false, version =
byteorder = "1.5"
serde = { version = "1", features = ["derive"] }
urlencoding = "2"
rand = "0.8"
rand = "0.9"
tracing = "0.1.40"
reqwest = { version = "0.12", default-features = false, features = ["json"] }
bencode = { path = "../bencode", default-features = false, package = "librqbit-bencode", version = "3" }
bencode = { path = "../bencode", default-features = false, package = "librqbit-bencode", version = "3.1" }
url = { version = "2", default-features = false }
parking_lot = "0.12.3"
tokio-util = "0.7.13"

View file

@ -29,7 +29,7 @@ const CONNECTION_ID_MAGIC: ConnectionId = 0x41727101980;
pub type TransactionId = u32;
pub fn new_transaction_id() -> TransactionId {
rand::thread_rng().gen()
rand::rng().random()
}
#[derive(Debug)]

View file

@ -1,6 +1,6 @@
[package]
name = "librqbit-upnp-serve"
version = "1.0.0"
version = "1.0.1"
edition = "2021"
description = "Simple UPnP MediaServer implementation"
license = "Apache-2.0"
@ -19,7 +19,7 @@ sha1-ring = ["librqbit-sha1-wrapper/sha1-ring", "librqbit-core/sha1-ring"]
[dependencies]
anyhow = "1.0.86"
axum = { version = "0.8", features = ["tokio"] }
tokio = { version = "1.39.3", features = ["full"] }
tokio = { version = "1", features = ["full"] }
tracing = "0.1.40"
bstr = "1.10.0"
serde = { version = "1", features = ["derive"] }
@ -27,7 +27,7 @@ http = "1.1.0"
httparse = "1.9.4"
uuid = { version = "1.10.0", features = ["v4"] }
librqbit-upnp = { version = "1", path = "../upnp", default-features = false }
gethostname = "0.5.0"
gethostname = "1"
librqbit-sha1-wrapper = { path = "../sha1w", version = "4", default-features = false }
librqbit-core = { version = "5", path = "../librqbit_core", default-features = false }
mime_guess = "2.0.5"

View file

@ -105,6 +105,7 @@ impl SubscribeRequest {
}
impl SubscribeRequest {
#[allow(clippy::result_large_err)]
pub fn parse(
request: axum::extract::Request,
) -> Result<SubscribeRequest, axum::response::Response> {

1286
desktop/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -9,25 +9,25 @@
"tauri": "tauri"
},
"dependencies": {
"@tauri-apps/api": "^2.0.1",
"@tauri-apps/plugin-shell": "^2.0.0",
"@tauri-apps/api": "^2.5.0",
"@tauri-apps/plugin-shell": "^2.2.1",
"lodash.debounce": "^4.0.8",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^5.3.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.5.0",
"rqbit-webui": "file:../crates/librqbit/webui"
},
"devDependencies": {
"@tauri-apps/cli": "2.0.0",
"@types/lodash.debounce": "^4.0.9",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@vitejs/plugin-react": "^4.0.3",
"autoprefixer": "^10.4.16",
"postcss": "^8.4.32",
"tailwindcss": "^3.3.6",
"typescript": "^5.0.2",
"vite": "^5.4.8",
"vite-plugin-svgr": "^4.2.0"
"@types/react": "^18.3.23",
"@types/react-dom": "^18.3.7",
"@vitejs/plugin-react": "^4.5.1",
"autoprefixer": "^10.4.21",
"postcss": "^8.5.4",
"tailwindcss": "^3.4.17",
"typescript": "^5.8.3",
"vite": "^6.3.5",
"vite-plugin-svgr": "^4.3.0"
}
}

View file

@ -1,6 +1,6 @@
[package]
name = "rqbit-desktop"
version = "8.0.0"
version = "8.1.0"
description = "rqbit torrent client"
authors = ["you"]
license = ""