[TBASE-1297]

This commit is contained in:
slguan 2019-12-08 15:27:25 +08:00
parent a20f3ef124
commit 8fa7038ee6
2 changed files with 5 additions and 5 deletions

View File

@ -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);

View File

@ -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;