提交 071ee977 编写于 作者: wmmhello's avatar wmmhello

fix:json parse error

上级 bed01128
...@@ -1040,6 +1040,8 @@ static int32_t smlParseJSONExt(SSmlHandle *info, char *payload) { ...@@ -1040,6 +1040,8 @@ static int32_t smlParseJSONExt(SSmlHandle *info, char *payload) {
if(ret != TSDB_CODE_SUCCESS){ if(ret != TSDB_CODE_SUCCESS){
return ret; return ret;
} }
info->parseJsonByLib = true;
cJSON *head = (payloadNum == 1 && cJSON_IsObject(info->root)) ? info->root : info->root->child; cJSON *head = (payloadNum == 1 && cJSON_IsObject(info->root)) ? info->root : info->root->child;
int cnt = 0; int cnt = 0;
...@@ -1173,7 +1175,6 @@ int32_t smlParseJSON(SSmlHandle *info, char *payload) { ...@@ -1173,7 +1175,6 @@ int32_t smlParseJSON(SSmlHandle *info, char *payload) {
} }
if (unlikely(ret != TSDB_CODE_SUCCESS)) { if (unlikely(ret != TSDB_CODE_SUCCESS)) {
uError("SML:0x%" PRIx64 " Invalid JSON Payload 1:%s", info->id, payload); uError("SML:0x%" PRIx64 " Invalid JSON Payload 1:%s", info->id, payload);
info->parseJsonByLib = true;
return smlParseJSONExt(info, payload); return smlParseJSONExt(info, payload);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册