!1631 [5.0.1]fix fd leak in tcp mode

Merge pull request !1631 from liurantao/OpenHarmony-5.0.1-Release
This commit is contained in:
openharmony_ci 2024-11-19 04:40:18 +00:00 committed by Gitee
commit c11b321230
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -575,6 +575,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) {