uring cancel callback release task correctly

master
YuQing 2025-11-03 14:56:29 +08:00
parent ddc528d69d
commit 1b2f521b99
1 changed files with 6 additions and 2 deletions

View File

@ -72,8 +72,12 @@ static int sf_uring_cancel_done(int sock, const int event, void *arg)
struct fast_task_info *task;
task = (struct fast_task_info *)arg;
if (event != IOEVENT_TIMEOUT) {
CLEAR_OP_TYPE_AND_RELEASE_TASK(task);
if (event != IOEVENT_TIMEOUT) ECANCEL{
if (task->handler->use_io_uring || (FC_URING_OP_TYPE(task) !=
IORING_OP_NOP && task->event.res == -ECANCELED))
{
CLEAR_OP_TYPE_AND_RELEASE_TASK(task);
}
}
return 0;
}