add the error code
This commit is contained in:
parent
916a7f292f
commit
3c09bc1e08
|
@ -2169,18 +2169,27 @@ int tscSetMgmtIpListFromCfg(const char *first, const char *second) {
|
||||||
tscMgmtIpSet.inUse = 0;
|
tscMgmtIpSet.inUse = 0;
|
||||||
|
|
||||||
if (first && first[0] != 0) {
|
if (first && first[0] != 0) {
|
||||||
if (strlen(first) >= TSDB_FQDN_LEN) return TSDB_CODE_INVALID_FQDN;
|
if (strlen(first) >= TSDB_FQDN_LEN) {
|
||||||
|
terrno = TSDB_CODE_INVALID_FQDN;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
taosGetFqdnPortFromEp(first, tscMgmtIpSet.fqdn[tscMgmtIpSet.numOfIps], &tscMgmtIpSet.port[tscMgmtIpSet.numOfIps]);
|
taosGetFqdnPortFromEp(first, tscMgmtIpSet.fqdn[tscMgmtIpSet.numOfIps], &tscMgmtIpSet.port[tscMgmtIpSet.numOfIps]);
|
||||||
tscMgmtIpSet.numOfIps++;
|
tscMgmtIpSet.numOfIps++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (second && second[0] != 0) {
|
if (second && second[0] != 0) {
|
||||||
if (strlen(second) >= TSDB_FQDN_LEN) return TSDB_CODE_INVALID_FQDN;
|
if (strlen(second) >= TSDB_FQDN_LEN) {
|
||||||
|
terrno = TSDB_CODE_INVALID_FQDN;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
taosGetFqdnPortFromEp(second, tscMgmtIpSet.fqdn[tscMgmtIpSet.numOfIps], &tscMgmtIpSet.port[tscMgmtIpSet.numOfIps]);
|
taosGetFqdnPortFromEp(second, tscMgmtIpSet.fqdn[tscMgmtIpSet.numOfIps], &tscMgmtIpSet.port[tscMgmtIpSet.numOfIps]);
|
||||||
tscMgmtIpSet.numOfIps++;
|
tscMgmtIpSet.numOfIps++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( tscMgmtIpSet.numOfIps == 0) return TSDB_CODE_INVALID_FQDN;
|
if ( tscMgmtIpSet.numOfIps == 0) {
|
||||||
|
terrno = TSDB_CODE_INVALID_FQDN;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue