Skip to content

Commit

Permalink
Dont wait for dispatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Sep 2, 2024
1 parent 11c01a5 commit 27a84cf
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions ntex-io/src/tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ impl ReadContext {
{
let inner = &self.0 .0;

// we already pushed new data to read buffer,
// we have to wait for dispatcher to read data from buffer
if inner.flags.get().is_read_buf_ready() {
task::yield_to().await;
}
// // we already pushed new data to read buffer,
// // we have to wait for dispatcher to read data from buffer
// if inner.flags.get().is_read_buf_ready() {
// task::yield_to().await;
// }

let mut buf = if inner.flags.get().is_read_buf_ready() {
// read buffer is still not read by dispatcher
Expand All @@ -175,9 +175,9 @@ impl ReadContext {
};

// make sure we've got room
let remaining = buf.remaining_mut();
let (hw, lw) = self.0.memory_pool().read_params().unpack();
if remaining < lw {
let remaining = buf.remaining_mut();
if remaining <= lw {
buf.reserve(hw - remaining);
}
let total = buf.len();
Expand Down

0 comments on commit 27a84cf

Please sign in to comment.