diff --git a/src/sync/src/syncMain.c b/src/sync/src/syncMain.c index e70e27b0efbb22c76b9044eec99d831eff94b62e..04e402769b513a269ac3c5a23d64e92318932bc4 100644 --- a/src/sync/src/syncMain.c +++ b/src/sync/src/syncMain.c @@ -537,7 +537,8 @@ static void syncResetFlowCtrl(SSyncNode *pNode) { pNode->peerInfo[i]->numOfRetrieves = 0; } - (*pNode->notifyFlowCtrl)(pNode->ahandle, 0); + if (pNode->notifyFlowCtrl) + (*pNode->notifyFlowCtrl)(pNode->ahandle, 0); } static void syncChooseMaster(SSyncNode *pNode) { diff --git a/src/sync/src/syncRetrieve.c b/src/sync/src/syncRetrieve.c index be3a3c2ac7b20e75aee1fea871bc6ae11f74d5a9..7bd97f5abec4204658d83b9f905cbf9dd902e63c 100644 --- a/src/sync/src/syncRetrieve.c +++ b/src/sync/src/syncRetrieve.c @@ -477,11 +477,12 @@ void *syncRetrieveData(void *param) if (pPeer->fileChanged) { // if file is changed 3 times continuously, start flow control pPeer->numOfRetrieves++; - if (pPeer->numOfRetrieves >= 3) + if (pPeer->numOfRetrieves >= 3 && pNode->notifyFlowCtrl) (*pNode->notifyFlowCtrl)(pNode->ahandle, pPeer->numOfRetrieves - 2); } else { pPeer->numOfRetrieves = 0; - (*pNode->notifyFlowCtrl)(pNode->ahandle, 0); + if (pNode->notifyFlowCtrl) + (*pNode->notifyFlowCtrl)(pNode->ahandle, 0); } pPeer->fileChanged = 0;