diff --git a/src/plugins/http/src/httpAuth.c b/src/plugins/http/src/httpAuth.c index 6350d80299c8702de76fa60e6dd40291d84f613a..0439083f31e5d4d7c9434535b6dd3f43a7fe6a65 100644 --- a/src/plugins/http/src/httpAuth.c +++ b/src/plugins/http/src/httpAuth.c @@ -73,6 +73,7 @@ bool httpParseTaosdAuthToken(HttpContext *pContext, char *token, int len) { unsigned char *base64 = base64_decode(token, len, &outlen); if (base64 == NULL || outlen == 0) { httpError("context:%p, fd:%d, ip:%s, taosd token:%s parsed error", pContext, pContext->fd, pContext->ipstr, token); + if (base64) free(base64); return false; } if (outlen != (TSDB_USER_LEN + TSDB_PASSWORD_LEN)) { diff --git a/src/plugins/http/src/httpContext.c b/src/plugins/http/src/httpContext.c index 183a332fb609cc896368ab61bcbce1109cbc3685..981492681a8b27c9f9b3cde402ee548f83d26a14 100644 --- a/src/plugins/http/src/httpContext.c +++ b/src/plugins/http/src/httpContext.c @@ -68,7 +68,6 @@ bool httpInitContexts() { } void httpCleanupContexts() { - // TODO: wait until all context is closed if (tsHttpServer.contextCache != NULL) { SCacheObj *cache = tsHttpServer.contextCache; httpPrint("context cache is cleanuping, size:%d", taosHashGetSize(cache->pHashTable)); diff --git a/src/plugins/http/src/httpServer.c b/src/plugins/http/src/httpServer.c index bea2bb083ace72bbaffc191d7d498c09ba967ffd..684f77e7d8829ed1e65dfae599f9edaac67fb1f8 100644 --- a/src/plugins/http/src/httpServer.c +++ b/src/plugins/http/src/httpServer.c @@ -56,8 +56,9 @@ static void httpStopThread(HttpThread* pThread) { void httpCleanUpConnect() { HttpServer *pServer = &tsHttpServer; - pthread_join(pServer->thread, NULL); + if (pServer->pThreads == NULL) return; + pthread_join(pServer->thread, NULL); for (int i = 0; i < pServer->numOfThreads; ++i) { HttpThread* pThread = pServer->pThreads + i; if (pThread != NULL) { @@ -195,9 +196,9 @@ static void httpProcessHttpData(void *param) { for (int i = 0; i < fdNum; ++i) { pContext = httpGetContext(events[i].data.ptr); if (pContext == NULL) { - httpError("fd:%d, is already released, close connect", events[i].data.fd); - epoll_ctl(pThread->pollFd, EPOLL_CTL_DEL, pContext->fd, NULL); - tclose(events[i].data.fd); + httpError("context:%p, is already released, close connect", events[i].data.ptr); + //epoll_ctl(pThread->pollFd, EPOLL_CTL_DEL, events[i].data.fd, NULL); + //tclose(events[i].data.fd); continue; } diff --git a/tests/script/general/db/len.sim b/tests/script/general/db/len.sim index 8add486658d1706348d9d1f3e6e443de262da54c..6082f891b2a059f45a7a8b33e2e94dca62b7565a 100644 --- a/tests/script/general/db/len.sim +++ b/tests/script/general/db/len.sim @@ -49,7 +49,7 @@ if $rows != 0 then endi print =============== step4 -sql create database a012345678901201234567890120123456789012 -x step4 +sql create database a012345678901201234567890120123456789012a012345678901201234567890120123456789012 -x step4 return -1 step4: sql show databases