[TBASE-1241]
This commit is contained in:
parent
8314e22328
commit
7d6db536d0
|
@ -222,6 +222,7 @@ typedef struct {
|
||||||
|
|
||||||
// internal part
|
// internal part
|
||||||
uint32_t destId;
|
uint32_t destId;
|
||||||
|
uint32_t destIp;
|
||||||
char meterId[TSDB_UNI_LEN];
|
char meterId[TSDB_UNI_LEN];
|
||||||
uint16_t port; // for UDP only
|
uint16_t port; // for UDP only
|
||||||
char empty[1];
|
char empty[1];
|
||||||
|
@ -663,6 +664,7 @@ typedef struct {
|
||||||
// internal message
|
// internal message
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t destId;
|
uint32_t destId;
|
||||||
|
uint32_t destIp;
|
||||||
char meterId[TSDB_UNI_LEN];
|
char meterId[TSDB_UNI_LEN];
|
||||||
char empty[3];
|
char empty[3];
|
||||||
char msgType;
|
char msgType;
|
||||||
|
|
|
@ -1219,6 +1219,7 @@ int taosSendMsgToPeerH(void *thandle, char *pCont, int contLen, void *ahandle) {
|
||||||
pServer = pConn->pServer;
|
pServer = pConn->pServer;
|
||||||
pChann = pServer->channList + pConn->chann;
|
pChann = pServer->channList + pConn->chann;
|
||||||
pHeader = (STaosHeader *)(pCont - sizeof(STaosHeader));
|
pHeader = (STaosHeader *)(pCont - sizeof(STaosHeader));
|
||||||
|
pHeader->destIp = pConn->peerIp;
|
||||||
msg = (char *)pHeader;
|
msg = (char *)pHeader;
|
||||||
|
|
||||||
if ((pHeader->msgType & 1U) == 0 && pConn->localPort) pHeader->port = pConn->localPort;
|
if ((pHeader->msgType & 1U) == 0 && pConn->localPort) pHeader->port = pConn->localPort;
|
||||||
|
|
|
@ -1298,13 +1298,12 @@ 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);
|
||||||
|
|
||||||
uint32_t peerIp = taosGetRpcLocalIp(thandle);
|
|
||||||
pConn->usePublicIp = (peerIp == tsPublicIpInt ? 1 : 0);
|
|
||||||
mPrint("pConn:%p is rebuild, peerIp:%s publicIp:%s usePublicIp:%u",
|
|
||||||
pConn, taosIpStr(peerIp), taosIpStr(tsPublicIpInt), pConn->usePublicIp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pConn->usePublicIp = (pMsg->destIp == tsPublicIpInt ? 1 : 0);
|
||||||
|
mTrace("pConn:%p, destIp:%s publicIp:%s usePublicIp:%u",
|
||||||
|
pConn, taosIpStr(pMsg->destIp), taosIpStr(tsPublicIpInt), pConn->usePublicIp);
|
||||||
|
|
||||||
if (pMsg->msgType == TSDB_MSG_TYPE_CONNECT) {
|
if (pMsg->msgType == TSDB_MSG_TYPE_CONNECT) {
|
||||||
(*mgmtProcessShellMsg[pMsg->msgType])((char *)pMsg->content, pMsg->msgLen - sizeof(SIntMsg), pConn);
|
(*mgmtProcessShellMsg[pMsg->msgType])((char *)pMsg->content, pMsg->msgLen - sizeof(SIntMsg), pConn);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue