From 8fa7038ee6b220bdd581b0082aebf2f12fd285dc Mon Sep 17 00:00:00 2001 From: slguan Date: Sun, 8 Dec 2019 15:27:25 +0800 Subject: [PATCH] [TBASE-1297] --- src/modules/http/src/httpServer.c | 6 +++--- src/modules/http/src/tgHandle.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modules/http/src/httpServer.c b/src/modules/http/src/httpServer.c index 232119b32a..171f811b7d 100644 --- a/src/modules/http/src/httpServer.c +++ b/src/modules/http/src/httpServer.c @@ -106,7 +106,7 @@ void httpCleanUpContextTimer(HttpContext *pContext) { } } -void httpCleanUpContext(HttpContext *pContext) { +void httpCleanUpContext(HttpContext *pContext, void *unused) { httpTrace("context:%p, start the clean up operation, sig:%p", pContext, pContext->signature); void *sig = atomic_val_compare_exchange_ptr(&pContext->signature, pContext, 0); if (sig == NULL) { @@ -184,7 +184,7 @@ bool httpInitContext(HttpContext *pContext) { void httpCloseContext(HttpThread *pThread, HttpContext *pContext) { - taosTmrReset(httpCleanUpContext, HTTP_DELAY_CLOSE_TIME_MS, pContext, pThread->pServer->timerHandle, &pContext->timer); + taosTmrReset((TAOS_TMR_CALLBACK)httpCleanUpContext, HTTP_DELAY_CLOSE_TIME_MS, pContext, pThread->pServer->timerHandle, &pContext->timer); httpTrace("context:%p, fd:%d, ip:%s, state:%s will be closed after:%d ms, timer:%p", pContext, pContext->fd, pContext->ipstr, httpContextStateStr(pContext->state), HTTP_DELAY_CLOSE_TIME_MS, pContext->timer); } @@ -273,7 +273,7 @@ void httpCleanUpConnect(HttpServer *pServer) { taosCloseSocket(pThread->pollFd); while (pThread->pHead) { - httpCleanUpContext(pThread->pHead); + httpCleanUpContext(pThread->pHead, 0); } pthread_cancel(pThread->thread); diff --git a/src/modules/http/src/tgHandle.c b/src/modules/http/src/tgHandle.c index ac17d6da09..bfbe7001a0 100644 --- a/src/modules/http/src/tgHandle.c +++ b/src/modules/http/src/tgHandle.c @@ -215,7 +215,7 @@ ParseEnd: } } -int tgParseSchema(char *content, char*fileName) { +int tgParseSchema(const char *content, char*fileName) { cJSON *root = cJSON_Parse(content); if (root == NULL) { httpError("failed to parse telegraf schema file:%s, invalid json format, content:%s", fileName, content); @@ -248,7 +248,7 @@ int tgParseSchema(char *content, char*fileName) { return size; } -int tgReadSchema(const char *fileName) { +int tgReadSchema(char *fileName) { FILE *fp = fopen(fileName, "r"); if (fp == NULL) { return -1; -- GitLab