Optimize the processing logic for sending messages during task execution. After the session has been released, intercept the information to be sent by the task and no longer send it

Signed-off-by: wenlong_12 <wenlong12@huawei.com>
Change-Id: I86507fab6891352854662c87492c01f271034e35
This commit is contained in:
wenlong_12 2024-09-19 18:37:09 +08:00
parent b59df0dfe9
commit 4c6c00b6b2

View File

@ -65,6 +65,11 @@ bool HdcTaskBase::SendToAnother(const uint16_t command, uint8_t *bufPtr, const i
return true;
} else {
HdcSessionBase *sessionBase = reinterpret_cast<HdcSessionBase *>(taskInfo->ownerSessionClass);
if (sessionBase->IsSessionDeleted(taskInfo->sessionId)) {
WRITE_LOG(LOG_FATAL, "SendToAnother session is deleted channelId:%u command:%u",
taskInfo->channelId, command);
return false;
}
return sessionBase->Send(taskInfo->sessionId, taskInfo->channelId, command, bufPtr, size) > 0;
}
}