提交 90c9eae2 编写于 作者: S Shengliang Guan

fd maybe reused while close httpcontext

上级 2927084a
...@@ -31,8 +31,8 @@ static void httpRemoveContextFromEpoll(HttpContext *pContext) { ...@@ -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);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册