[TBASE-1241]
This commit is contained in:
parent
a3c0c50d90
commit
6dfc958cf4
|
@ -109,8 +109,6 @@ int taosSetSecurityInfo(int cid, int sid, char *id, int spi, int encrypt, char *
|
||||||
|
|
||||||
void taosGetRpcConnInfo(void *thandle, uint32_t *peerId, uint32_t *peerIp, uint16_t *peerPort, int *cid, int *sid);
|
void taosGetRpcConnInfo(void *thandle, uint32_t *peerId, uint32_t *peerIp, uint16_t *peerPort, int *cid, int *sid);
|
||||||
|
|
||||||
uint32_t taosGetRpcLocalIp(void *thandle);
|
|
||||||
|
|
||||||
int taosGetOutType(void *thandle);
|
int taosGetOutType(void *thandle);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -1411,11 +1411,6 @@ void taosGetRpcConnInfo(void *thandle, uint32_t *peerId, uint32_t *peerIp, uint1
|
||||||
*sid = pConn->sid;
|
*sid = pConn->sid;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t taosGetRpcLocalIp(void *thandle) {
|
|
||||||
SRpcConn *pConn = (SRpcConn *)thandle;
|
|
||||||
return pConn->peerIp;
|
|
||||||
}
|
|
||||||
|
|
||||||
int taosGetOutType(void *thandle) {
|
int taosGetOutType(void *thandle) {
|
||||||
SRpcConn *pConn = (SRpcConn *)thandle;
|
SRpcConn *pConn = (SRpcConn *)thandle;
|
||||||
if (pConn == NULL) return -1;
|
if (pConn == NULL) return -1;
|
||||||
|
|
|
@ -1220,11 +1220,8 @@ int mgmtProcessConnectMsg(char *pMsg, int msgLen, SConnObj *pConn) {
|
||||||
pConn->pAcct = pAcct;
|
pConn->pAcct = pAcct;
|
||||||
pConn->pDb = pDb;
|
pConn->pDb = pDb;
|
||||||
pConn->pUser = pUser;
|
pConn->pUser = pUser;
|
||||||
|
|
||||||
uint32_t peerIp = taosGetRpcLocalIp(pConn->thandle);
|
|
||||||
pConn->usePublicIp = (peerIp == tsPublicIpInt ? 1 : 0);
|
|
||||||
mgmtEstablishConn(pConn);
|
mgmtEstablishConn(pConn);
|
||||||
|
|
||||||
_rsp:
|
_rsp:
|
||||||
pStart = taosBuildRspMsgWithSize(pConn->thandle, TSDB_MSG_TYPE_CONNECT_RSP, 128);
|
pStart = taosBuildRspMsgWithSize(pConn->thandle, TSDB_MSG_TYPE_CONNECT_RSP, 128);
|
||||||
if (pStart == NULL) return 0;
|
if (pStart == NULL) return 0;
|
||||||
|
@ -1298,10 +1295,9 @@ void *mgmtProcessMsgFromShell(char *msg, void *ahandle, void *thandle) {
|
||||||
pConn = connList + pMsg->destId;
|
pConn = connList + pMsg->destId;
|
||||||
pConn->thandle = thandle;
|
pConn->thandle = thandle;
|
||||||
strcpy(pConn->user, pMsg->meterId);
|
strcpy(pConn->user, pMsg->meterId);
|
||||||
|
|
||||||
pConn->usePublicIp = (pMsg->destIp == tsPublicIpInt ? 1 : 0);
|
pConn->usePublicIp = (pMsg->destIp == tsPublicIpInt ? 1 : 0);
|
||||||
mPrint("pConn:%p is rebuild, destIp:%s publicIp:%s usePublicIp:%u",
|
mTrace("pConn:%p is rebuild, destIp:%s publicIp:%s usePublicIp:%u",
|
||||||
pConn, taosIpStr(pMsg->destIp), taosIpStr(tsPublicIpInt), pConn->usePublicIp);
|
pConn, taosIpStr(pMsg->destIp), taosIpStr(tsPublicIpInt), pConn->usePublicIp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pMsg->msgType == TSDB_MSG_TYPE_CONNECT) {
|
if (pMsg->msgType == TSDB_MSG_TYPE_CONNECT) {
|
||||||
|
|
Loading…
Reference in New Issue