enh(rpc): validate fqdn

This commit is contained in:
yihaoDeng 2022-05-06 14:27:49 +08:00
parent 315c9c37dc
commit f2eca15fe2
1 changed files with 6 additions and 1 deletions

View File

@ -111,11 +111,16 @@ void shellNettestHandler(int32_t signum, void *sigInfo, void *context) { shellEx
static void shellWorkAsServer() { static void shellWorkAsServer() {
SShellArgs *pArgs = &shell.args; SShellArgs *pArgs = &shell.args;
// char fqdn[TSDB_FQDN_LEN] = {0};
/// tstrncpy(fqdn, pArgs->host, TSDB_FQDN_LEN);
// strtok(fqdn, ":");
if (pArgs->port == 0) { if (pArgs->port == 0) {
pArgs->port = tsServerPort; pArgs->port = tsServerPort;
} }
SRpcInit rpcInit = {0}; SRpcInit rpcInit = {0};
memcpy(rpcInit.localFqdn, tsLocalFqdn, strlen(tsLocalFqdn));
rpcInit.localPort = pArgs->port; rpcInit.localPort = pArgs->port;
rpcInit.label = "CHK"; rpcInit.label = "CHK";
rpcInit.numOfThreads = tsNumOfRpcThreads; rpcInit.numOfThreads = tsNumOfRpcThreads;