Skip to content

Commit 3e0124d

Browse files
authored
Upgrade to ntex-service v4 (#698)
1 parent 6a4b10b commit 3e0124d

38 files changed

+136
-415
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ ntex-util = { path = "ntex-util" }
4545
ntex-compio = { path = "ntex-compio" }
4646
ntex-tokio = { path = "ntex-tokio" }
4747

48+
ntex-h2 = { git = "https://github.com/ntex-rs/ntex-h2.git" }
49+
4850
[workspace.dependencies]
4951
async-channel = "2"
5052
async-task = "4.5.0"

ntex-compio/CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes
22

3+
## [3.4.0] - 2025-12-17
4+
5+
* Upgrade to ntex-service v4
6+
37
## [3.3.0] - 2025-12-16
48

59
* Stop io context after disconnect

ntex-compio/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ntex-compio"
3-
version = "3.3.0"
3+
version = "3.4.0"
44
authors = ["ntex contributors <team@ntex.rs>"]
55
description = "compio runtime intergration for ntex framework"
66
keywords = ["network", "framework", "async", "futures"]
@@ -27,7 +27,7 @@ ntex-bytes = "1"
2727
ntex-io = "3"
2828
ntex-util = "3"
2929
ntex-rt = "3.3"
30-
ntex-service = "3.8"
30+
ntex-service = "4"
3131
log = { workspace = true }
3232

3333
compio-buf = "0.7"

ntex-io/CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes
22

3+
## [3.3.0] - 2025-12-17
4+
5+
* Upgrade to ntex-service v4
6+
37
## [3.2.0] - 2025-12-16
48

59
* Shutdown service if readiness fails

ntex-io/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ntex-io"
3-
version = "3.2.0"
3+
version = "3.3.0"
44
authors = ["ntex contributors <team@ntex.rs>"]
55
description = "Utilities for abstracting io streams"
66
keywords = ["network", "framework", "async", "futures"]
@@ -19,13 +19,13 @@ path = "src/lib.rs"
1919
[dependencies]
2020
ntex-codec = "1"
2121
ntex-bytes = "1"
22-
ntex-util = "3.3"
23-
ntex-service = "3.7.3"
22+
ntex-util = "3"
23+
ntex-service = "4"
2424

2525
bitflags = { workspace = true }
2626
log = { workspace = true }
2727
pin-project-lite = { workspace = true }
2828

2929
[dev-dependencies]
30-
ntex = "3.0.0-pre.7"
30+
ntex = "3.0.0-pre.8"
3131
rand = { workspace = true }

ntex-net/CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes
22

3+
## [3.4.0] - 2025-12-17
4+
5+
* Upgrade to ntex-service v4
6+
37
## [3.3.1] - 2025-12-16
48

59
* Refactor neon and neon-uring drivers

ntex-net/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ntex-net"
3-
version = "3.3.1"
3+
version = "3.4.0"
44
authors = ["ntex contributors <team@ntex.rs>"]
55
description = "ntexwork utils for ntex framework"
66
keywords = ["network", "framework", "async", "futures"]
@@ -32,15 +32,15 @@ io-uring = ["ntex-neon/io-uring", "socket2"]
3232
io-uring-compat = []
3333

3434
[dependencies]
35-
ntex-service = "3.8"
35+
ntex-service = "4"
3636
ntex-bytes = "1"
3737
ntex-http = "1"
3838
ntex-io = "3"
3939
ntex-rt = "3.3"
4040
ntex-util = "3"
4141

42-
ntex-tokio = { version = "3.0.0", optional = true }
43-
ntex-compio = { version = "3.3.0", optional = true }
42+
ntex-tokio = { version = "3.1.0", optional = true }
43+
ntex-compio = { version = "3.4.0", optional = true }
4444
ntex-neon = { version = "0.2.2", optional = true }
4545

4646
bitflags = { workspace = true }
@@ -52,5 +52,5 @@ socket2 = { workspace = true, optional = true, features = ["all"] }
5252
thiserror = { workspace = true }
5353

5454
[dev-dependencies]
55-
ntex = "3.0.0-pre.7"
55+
ntex = "3.0.0-pre.8"
5656
oneshot = "0.1"

ntex-net/src/rt_uring/driver.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ struct StreamOpsInner {
9292
struct StreamOpsStorage {
9393
ops: Slab<Option<Operation>>,
9494
streams: Slab<StreamItem>,
95-
lw: usize,
96-
hw: usize,
9795
}
9896

9997
impl StreamOps {
@@ -125,8 +123,6 @@ impl StreamOps {
125123
storage: Cell::new(Some(Box::new(StreamOpsStorage {
126124
ops,
127125
streams: Slab::new(),
128-
lw: 1024,
129-
hw: 1024 * 16,
130126
}))),
131127
});
132128
inner = Some(ops.clone());
@@ -145,10 +141,10 @@ impl StreamOps {
145141
) -> (StreamCtl, WeakStreamCtl) {
146142
let item = StreamItem {
147143
io,
144+
ctx,
148145
rd_op: None,
149146
wr_op: None,
150147
flags: if zc { self.0.default_flags } else { Flags::NO_ZC },
151-
ctx: ctx.clone(),
152148
};
153149

154150
let id = self.0.with(move |st| {
@@ -232,6 +228,7 @@ impl Handler for StreamOpsHandler {
232228
} else {
233229
let mut total = 0;
234230
let res = Poll::Ready(res.map(|size| {
231+
// SAFETY: kernel tells us how many bytes it read
235232
unsafe { buf.advance_mut(size) };
236233
total = size;
237234
}).map_err(Some));
@@ -355,9 +352,8 @@ impl StreamOpsStorage {
355352

356353
fn recv_more(&mut self, id: usize, mut buf: BytesVec, api: &DriverApi) {
357354
if let Some(item) = self.streams.get_mut(id) {
358-
if buf.remaining_mut() < self.lw {
359-
buf.reserve(self.hw);
360-
}
355+
item.ctx.resize_read_buf(&mut buf);
356+
361357
let slice = buf.chunk_mut();
362358
let buf_ptr = slice.as_mut_ptr();
363359
let buf_len = slice.len() as u32;
@@ -528,7 +524,6 @@ impl StreamCtl {
528524

529525
impl Drop for StreamCtl {
530526
fn drop(&mut self) {
531-
println!("DROP CTL {:?}", self.id);
532527
self.inner.drop_stream(self.id);
533528
}
534529
}

ntex-server/CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changes
22

3+
## [3.4.0] - 2025-12-17
4+
5+
* Upgrade to ntex-service v4
6+
7+
* Improve test servers shutdown process
8+
39
## [3.3.0] - 2025-12-05
410

511
* Use AsyncFn for on-accept callback

ntex-server/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ntex-server"
3-
version = "3.3.0"
3+
version = "3.4.0"
44
authors = ["ntex contributors <team@ntex.rs>"]
55
description = "Server for ntex framework"
66
keywords = ["network", "framework", "async", "futures"]
@@ -19,7 +19,7 @@ path = "src/lib.rs"
1919
[dependencies]
2020
ntex-io = "3"
2121
ntex-net = "3.2"
22-
ntex-service = "3.7"
22+
ntex-service = "4"
2323
ntex-rt = "3"
2424
ntex-util = "3"
2525

0 commit comments

Comments
 (0)