enh(rpc): validate fqdn
This commit is contained in:
parent
78c617a9f1
commit
699c8a0461
|
@ -51,6 +51,7 @@ void* rpcOpen(const SRpcInit* pInit) {
|
|||
ip = taosGetIpv4FromFqdn(pInit->localFqdn);
|
||||
if (ip == 0xFFFFFFFF) {
|
||||
tError("invalid fqdn: %s", pInit->localFqdn);
|
||||
terrno = TSDB_CODE_RPC_FQDN_ERROR;
|
||||
taosMemoryFree(pRpc);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -841,7 +841,7 @@ void* transInitServer(uint32_t ip, uint32_t port, char* label, int numOfThreads,
|
|||
}
|
||||
}
|
||||
if (false == taosValidIpAndPort(srv->ip, srv->port)) {
|
||||
tError("failed to bind, reason: %s", strerror(errno));
|
||||
tError("failed to bind, reason: %s", terrstr());
|
||||
goto End;
|
||||
}
|
||||
if (false == addHandleToAcceptloop(srv)) {
|
||||
|
|
|
@ -127,7 +127,7 @@ static void shellWorkAsServer() {
|
|||
|
||||
void *serverRpc = rpcOpen(&rpcInit);
|
||||
if (serverRpc == NULL) {
|
||||
printf("failed to init net test server since %s", terrstr());
|
||||
printf("failed to init net test server since %s\n", terrstr());
|
||||
} else {
|
||||
printf("network test server is initialized, port:%u\n", pArgs->port);
|
||||
taosSetSignal(SIGTERM, shellNettestHandler);
|
||||
|
|
Loading…
Reference in New Issue