提交 f2eca15f 编写于 作者: dengyihao's avatar dengyihao

enh(rpc): validate fqdn

上级 315c9c37
...@@ -21,7 +21,7 @@ static void shellWorkAsClient() { ...@@ -21,7 +21,7 @@ static void shellWorkAsClient() {
SRpcInit rpcInit = {0}; SRpcInit rpcInit = {0};
SEpSet epSet = {.inUse = 0, .numOfEps = 1}; SEpSet epSet = {.inUse = 0, .numOfEps = 1};
SRpcMsg rpcRsp = {0}; SRpcMsg rpcRsp = {0};
void *clientRpc = NULL; void * clientRpc = NULL;
char pass[TSDB_PASSWORD_LEN + 1] = {0}; char pass[TSDB_PASSWORD_LEN + 1] = {0};
taosEncryptPass_c((uint8_t *)("_pwd"), strlen("_pwd"), pass); taosEncryptPass_c((uint8_t *)("_pwd"), strlen("_pwd"), pass);
...@@ -111,11 +111,16 @@ void shellNettestHandler(int32_t signum, void *sigInfo, void *context) { shellEx ...@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册