diff --git a/src/modules/http/src/httpServer.c b/src/modules/http/src/httpServer.c index 4c20297f77e1205c625ffbbaa76a482a343785ae..16c4b968fd9fd04c7d381494cf762b3f24000119 100644 --- a/src/modules/http/src/httpServer.c +++ b/src/modules/http/src/httpServer.c @@ -183,6 +183,10 @@ void httpCloseContextByApp(HttpContext *pContext) { } pthread_mutex_lock(&pContext->mutex); + if (pContext->signature != pContext || pContext->fd <= 0) { + return; + } + pContext->parsed = false; httpTrace("context:%p, fd:%d, ip:%s, app use finished, usedByEpoll:%d, usedByApp:%d, httpVersion:1.%d, keepAlive:%d", @@ -208,6 +212,10 @@ void httpCloseContextByServer(HttpThread *pThread, HttpContext *pContext) { return; } pthread_mutex_lock(&pContext->mutex); + if (pContext->signature != pContext || pContext->fd <= 0) { + return; + } + pContext->usedByEpoll = 0; pContext->parsed = false;