From d4bf3b567d1da5932d5694ca55d517827e9f335f Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Thu, 12 Aug 2021 16:57:01 +0800 Subject: [PATCH] [TD-5861]:add copyright and add quote to string --- src/plugins/http/inc/httpMetricsHandle.h | 18 ++++++++++++++---- src/plugins/http/src/httpMetricsHandle.c | 21 ++++++++++++++++----- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/plugins/http/inc/httpMetricsHandle.h b/src/plugins/http/inc/httpMetricsHandle.h index 77211e7a7b..e05a8ce687 100644 --- a/src/plugins/http/inc/httpMetricsHandle.h +++ b/src/plugins/http/inc/httpMetricsHandle.h @@ -1,7 +1,17 @@ -// -// Created by slzhou on 8/6/21. -// - +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ #ifndef TDENGINE_HTTPMETRICSHANDLE_H #define TDENGINE_HTTPMETRICSHANDLE_H diff --git a/src/plugins/http/src/httpMetricsHandle.c b/src/plugins/http/src/httpMetricsHandle.c index 9a9e564823..dbabd48774 100644 --- a/src/plugins/http/src/httpMetricsHandle.c +++ b/src/plugins/http/src/httpMetricsHandle.c @@ -1,6 +1,17 @@ -// -// Created by slzhou on 8/6/21. -// +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ #define _DEFAULT_SOURCE #include "os.h" #include "taoserror.h" @@ -39,8 +50,8 @@ bool metricsProcessRequest(HttpContext* pContext) { httpJsonToken(jsonBuf, JsonObjStt); char* keyTagName = "name"; char* keyTagValue = "value"; - httpJsonPairOriginString(jsonBuf, keyTagName, (int32_t)strlen(keyTagName), "dnode_id", - (int32_t)strlen("dnode_id")); + httpJsonPairOriginString(jsonBuf, keyTagName, (int32_t)strlen(keyTagName), "\"dnode_id\"", + (int32_t)strlen("\"dnode_id\"")); int32_t dnodeId = dnodeGetDnodeId(); httpJsonPairIntVal(jsonBuf, keyTagValue, (int32_t)strlen(keyTagValue), dnodeId); httpJsonToken(jsonBuf, JsonObjEnd); -- GitLab