Fix operation cancelation handling for io-uring driver (#527)

This commit is contained in:
Nikolay Kim 2025-03-14 22:46:48 +05:00 committed by GitHub
parent 5db953cea5
commit ae5980cdd9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 2 deletions

View file

@ -1,5 +1,9 @@
# Changes
## [2.5.2] - 2025-03-14
* Fix operation cancelation handling for io-uring driver
## [2.5.1] - 2025-03-14
* Fix socket connect for io-uring driver

View file

@ -1,6 +1,6 @@
[package]
name = "ntex-net"
version = "2.5.1"
version = "2.5.2"
authors = ["ntex contributors <team@ntex.rs>"]
description = "ntexwork utils for ntex framework"
keywords = ["network", "framework", "async", "futures"]

View file

@ -118,10 +118,16 @@ impl<T> Handler for StreamOpsHandler<T> {
Operation::Recv { id, buf, context } => {
log::debug!("{}: Recv canceled {:?}", context.tag(), id,);
context.release_read_buf(buf);
if let Some(item) = storage.streams.get_mut(id) {
item.rd_op.take();
}
}
Operation::Send { id, buf, context } => {
log::debug!("{}: Send canceled: {:?}", context.tag(), id);
context.release_write_buf(buf);
if let Some(item) = storage.streams.get_mut(id) {
item.wr_op.take();
}
}
Operation::Nop | Operation::Close { .. } => {}
}

View file

@ -68,7 +68,6 @@ async fn run<T>(ctl: StreamCtl<T>, context: IoContext) {
let write = match context.poll_write_ready(cx) {
Poll::Ready(WriteStatus::Ready) => {
log::debug!("{}: write ready", context.tag());
ctl.resume_write();
Poll::Pending
}