提交 8fa7038e 编写于 作者: S slguan

[TBASE-1297]

上级 a20f3ef1
...@@ -106,7 +106,7 @@ void httpCleanUpContextTimer(HttpContext *pContext) { ...@@ -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); httpTrace("context:%p, start the clean up operation, sig:%p", pContext, pContext->signature);
void *sig = atomic_val_compare_exchange_ptr(&pContext->signature, pContext, 0); void *sig = atomic_val_compare_exchange_ptr(&pContext->signature, pContext, 0);
if (sig == NULL) { if (sig == NULL) {
...@@ -184,7 +184,7 @@ bool httpInitContext(HttpContext *pContext) { ...@@ -184,7 +184,7 @@ bool httpInitContext(HttpContext *pContext) {
void httpCloseContext(HttpThread *pThread, 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", 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); pContext, pContext->fd, pContext->ipstr, httpContextStateStr(pContext->state), HTTP_DELAY_CLOSE_TIME_MS, pContext->timer);
} }
...@@ -273,7 +273,7 @@ void httpCleanUpConnect(HttpServer *pServer) { ...@@ -273,7 +273,7 @@ void httpCleanUpConnect(HttpServer *pServer) {
taosCloseSocket(pThread->pollFd); taosCloseSocket(pThread->pollFd);
while (pThread->pHead) { while (pThread->pHead) {
httpCleanUpContext(pThread->pHead); httpCleanUpContext(pThread->pHead, 0);
} }
pthread_cancel(pThread->thread); pthread_cancel(pThread->thread);
......
...@@ -215,7 +215,7 @@ ParseEnd: ...@@ -215,7 +215,7 @@ ParseEnd:
} }
} }
int tgParseSchema(char *content, char*fileName) { int tgParseSchema(const char *content, char*fileName) {
cJSON *root = cJSON_Parse(content); cJSON *root = cJSON_Parse(content);
if (root == NULL) { if (root == NULL) {
httpError("failed to parse telegraf schema file:%s, invalid json format, content:%s", fileName, content); 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) { ...@@ -248,7 +248,7 @@ int tgParseSchema(char *content, char*fileName) {
return size; return size;
} }
int tgReadSchema(const char *fileName) { int tgReadSchema(char *fileName) {
FILE *fp = fopen(fileName, "r"); FILE *fp = fopen(fileName, "r");
if (fp == NULL) { if (fp == NULL) {
return -1; return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册