refactor code
This commit is contained in:
parent
31534ad197
commit
3d0ce022f0
|
@ -91,7 +91,7 @@ static SSqlObj *taosConnectImpl(const char *ip, const char *user, const char *pa
|
|||
if (tscSetMgmtEpSetFromCfg(tsFirst, tsSecond, &corMgmtEpSet) < 0) return NULL;
|
||||
}
|
||||
char rpcKey[512] = {0};
|
||||
sprintf(rpcKey, "%s:%s:%s:%d", user, pass, ip, port);
|
||||
snprintf(rpcKey, sizeof(rpcKey), "%s:%s:%s:%d", user, pass, ip, port);
|
||||
|
||||
void *pRpcObj = NULL;
|
||||
if (tscAcquireRpc(rpcKey, user, secretEncrypt,&corMgmtEpSet, &pRpcObj) != 0) {
|
||||
|
|
|
@ -109,6 +109,7 @@ int32_t tscAcquireRpc(const char *key, const char *user, const char *secretEncry
|
|||
if (pRpcObj->tscCorMgmtEpSet == NULL) {
|
||||
rpcClose(rpcObj.pDnodeConn);
|
||||
pthread_mutex_unlock(&rpcObjMutex);
|
||||
return -1;
|
||||
}
|
||||
memcpy(pRpcObj->tscCorMgmtEpSet, corMgmtEpSet, sizeof(*corMgmtEpSet));
|
||||
|
||||
|
|
Loading…
Reference in New Issue