add rpc update interface
This commit is contained in:
parent
147de26eec
commit
f4f97a67f5
|
@ -160,7 +160,7 @@ void destroyIpWhiteTab(SHashObj *pIpWhiteTab) {
|
||||||
while (pIter) {
|
while (pIter) {
|
||||||
SIpWhiteList *list = *(SIpWhiteList **)pIter;
|
SIpWhiteList *list = *(SIpWhiteList **)pIter;
|
||||||
taosMemoryFree(list);
|
taosMemoryFree(list);
|
||||||
pIter = taosHashIterate(pIpWhiteTab, NULL);
|
pIter = taosHashIterate(pIpWhiteTab, pIter);
|
||||||
}
|
}
|
||||||
|
|
||||||
taosHashCleanup(pIpWhiteTab);
|
taosHashCleanup(pIpWhiteTab);
|
||||||
|
@ -1415,11 +1415,18 @@ static int32_t mndProcessAlterUserReq(SRpcMsg *pReq) {
|
||||||
|
|
||||||
if (pUser->pIpWhiteList->num > 0) {
|
if (pUser->pIpWhiteList->num > 0) {
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
for (int i = 0; i < alterReq.numIpRanges; i++) {
|
for (int i = 0; i < pUser->pIpWhiteList->num; i++) {
|
||||||
SIpV4Range *range = &(alterReq.pIpRanges[i]);
|
SIpV4Range *oldRange = &pUser->pIpWhiteList->pIpRange[i];
|
||||||
if (!isRangeInIpWhiteList(pUser->pIpWhiteList, range)) {
|
bool found = false;
|
||||||
// already exist, just ignore;
|
for (int j = 0; j < alterReq.numIpRanges; j++) {
|
||||||
memcpy(&pNew->pIpRange[idx], &pUser->pIpWhiteList->pIpRange[i], sizeof(SIpV4Range));
|
SIpV4Range *range = &alterReq.pIpRanges[j];
|
||||||
|
if (isIpRangeEqual(oldRange, range)) {
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (found == false) {
|
||||||
|
memcpy(&pNew->pIpRange[idx], oldRange, sizeof(SIpV4Range));
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue