fd maybe reused while close httpcontext
This commit is contained in:
parent
2927084a49
commit
90c9eae23e
|
@ -31,8 +31,8 @@ static void httpRemoveContextFromEpoll(HttpContext *pContext) {
|
||||||
HttpThread *pThread = pContext->pThread;
|
HttpThread *pThread = pContext->pThread;
|
||||||
if (pContext->fd >= 0) {
|
if (pContext->fd >= 0) {
|
||||||
epoll_ctl(pThread->pollFd, EPOLL_CTL_DEL, pContext->fd, NULL);
|
epoll_ctl(pThread->pollFd, EPOLL_CTL_DEL, pContext->fd, NULL);
|
||||||
taosCloseSocket(pContext->fd);
|
int32_t fd = atomic_val_compare_exchange_32(&pContext->fd, pContext->fd, -1);
|
||||||
pContext->fd = -1;
|
taosCloseSocket(fd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue