Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# Changes

## [4.2.0] - Unreleased
## [4.3.0] - 2026-10-17

* Replace `nanorand` with `fastrand`. `nanorand` does not link `advapi32` on Windows
(unresolved `SystemFunction036`), and the client pool seeded a new generator from
the OS for every request

* Avoid temporary byte slices when consuming HPACK headers and discard string prefixes
before slicing values, allowing more short values to use inline storage

## [4.2.0] - 2026-10-05

* Client APIs take a `secure` flag instead of `ntex_http::uri::Scheme`,
`Connector::scheme()` and `ClientBuilder::scheme()` are renamed to `secure()`

Expand Down
12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ntex-h2"
version = "4.2.0"
version = "4.3.0"
license = "MIT OR Apache-2.0"
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
description = "An HTTP/2 client and server"
Expand All @@ -23,23 +23,23 @@
features = []

[dependencies]
ntex-bytes = "1.11"
ntex-bytes = "1.12"
ntex-codec = "2.0"
ntex-dispatcher = "4.3"
ntex-error = "3.0"
ntex-http = "2.0"
ntex-io = "4.3"
ntex-net = "4.3"
ntex-io = "4.4"
ntex-net = "4.4"
ntex-service = "5.2"
ntex-util = "4.3"
ntex-server = "4.2"

Check warning on line 35 in Cargo.toml

View workflow job for this annotation

GitHub Actions / Test (nightly)

unused dependency `ntex-server`

Check warning on line 35 in Cargo.toml

View workflow job for this annotation

GitHub Actions / Test (nightly)

unused dependency `ntex-server`

Check warning on line 35 in Cargo.toml

View workflow job for this annotation

GitHub Actions / Test (beta)

unused dependency `ntex-server`

Check warning on line 35 in Cargo.toml

View workflow job for this annotation

GitHub Actions / Test (beta)

unused dependency `ntex-server`

bitflags = "2"
fastrand = "2.3"
foldhash = "0.2"
log = "0.4"
pin-project-lite = "0.2"
thiserror = "2"
nanorand = { version = "0.8", default-features = false, features = ["std", "wyrand", "entropy", "tls"] }

[dev-dependencies]
# Fuzzing
Expand All @@ -52,7 +52,7 @@
serde = "1"
serde_json = "1"

ntex = { version = "4.0.0-beta.18", features = ["openssl"] }
ntex = { version = "4.3.0", features = ["openssl"] }
ntex-tls = { version = "4.3.1", features = ["openssl"] }
openssl = "0.10"

Expand Down
3 changes: 1 addition & 2 deletions src/client/pool.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::collections::VecDeque;
use std::{cell::Cell, cell::RefCell, fmt, marker::PhantomData, rc::Rc, time::Duration};

use nanorand::{Rng, WyRand};
use ntex_bytes::ByteString;
use ntex_error::Error;
use ntex_http::{HeaderMap, Method};
Expand Down Expand Up @@ -156,7 +155,7 @@ impl Client {
// check existing connections
let available = connections.iter().filter(|item| item.is_ready()).count();
let client = if available > 0 {
let idx = WyRand::new().generate_range(0_usize..available);
let idx = fastrand::usize(..available);
connections
.iter()
.filter(|item| item.is_ready())
Expand Down
5 changes: 1 addition & 4 deletions src/client/simple.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::{fmt, future::Future, pin::Pin, rc::Rc, task::Context, task::Poll, time::SystemTime};

use nanorand::Rng;
use ntex_bytes::{BufMut, ByteString, BytesMut};
use ntex_dispatcher::Dispatcher as IoDispatcher;
use ntex_error::Error;
Expand Down Expand Up @@ -387,11 +386,9 @@ impl Future for ClientDisconnect {
fn gen_id() -> ByteString {
const BASE: &[u8] = b"abcdefghijklmnopqrstuvwxyz234567";

let mut rng = nanorand::tls_rng();
let mut id = BytesMut::with_capacity(16);
for _ in 0..16 {
let idx = rng.generate_range::<usize, _>(..BASE.len());
id.put_u8(BASE[idx]);
id.put_u8(BASE[fastrand::usize(..BASE.len())]);
}
ByteString::try_from(id).unwrap()
}
Loading