Skip to content

Commit

Permalink
Merge pull request #747 from taosdata/feat/TD-30413
Browse files Browse the repository at this point in the history
Support host port argument with json file currently
  • Loading branch information
DuanKuanJun committed Jun 5, 2024
2 parents 22f9a5f + 47db1ed commit b6a13a1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/benchJsonOpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1390,12 +1390,20 @@ static int getMetaFromCommonJsonFile(tools_cJSON *json) {

tools_cJSON *host = tools_cJSON_GetObjectItem(json, "host");
if (host && host->type == tools_cJSON_String && host->valuestring != NULL) {
g_arguments->host = host->valuestring;
if(g_arguments->host && strlen(g_arguments->host) > 0) {
warnPrint("command line already pass host is %s, json config host(%s) had been ignored.\n", g_arguments->host, host->valuestring);
} else {
g_arguments->host = host->valuestring;
}
}

tools_cJSON *port = tools_cJSON_GetObjectItem(json, "port");
if (port && port->type == tools_cJSON_Number) {
g_arguments->port = (uint16_t)port->valueint;
if(g_arguments->port != DEFAULT_PORT) {
warnPrint("command line already pass port is %d, json config port(%d) had been ignored.\n", g_arguments->port, (uint16_t)port->valueint);
} else {
g_arguments->port = (uint16_t)port->valueint;
}
}

tools_cJSON *user = tools_cJSON_GetObjectItem(json, "user");
Expand Down

0 comments on commit b6a13a1

Please sign in to comment.