fix fd leak in tcp mode

Signed-off-by: zhaolihui <zhaolihui2@huawei.com>
This commit is contained in:
zhaolihui 2024-10-23 16:25:34 +08:00
parent 1622934b29
commit c1c8893f7f

View File

@ -586,6 +586,7 @@ void HdcSessionBase::FreeSessionContinue(HSession hSession)
if (hSession->connType == CONN_TCP) {
// Turn off TCP to prevent continuing writing
Base::TryCloseHandle((uv_handle_t *)&hSession->hWorkTCP, true, closeSessionTCPHandle);
Base::CloseFd(hSession->dataFd[STREAM_WORK]);
}
hSession->availTailIndex = 0;
if (hSession->ioBuf) {