fd maybe reused while close httpcontext

This commit is contained in:
Shengliang Guan 2020-08-01 12:37:38 +08:00
parent 2927084a49
commit 90c9eae23e
1 changed files with 2 additions and 2 deletions

View File

@ -31,8 +31,8 @@ static void httpRemoveContextFromEpoll(HttpContext *pContext) {
HttpThread *pThread = pContext->pThread;
if (pContext->fd >= 0) {
epoll_ctl(pThread->pollFd, EPOLL_CTL_DEL, pContext->fd, NULL);
taosCloseSocket(pContext->fd);
pContext->fd = -1;
int32_t fd = atomic_val_compare_exchange_32(&pContext->fd, pContext->fd, -1);
taosCloseSocket(fd);
}
}