function pointer may be null
This commit is contained in:
parent
c9bcfe5fa6
commit
be58861a59
|
@ -537,7 +537,8 @@ static void syncResetFlowCtrl(SSyncNode *pNode) {
|
||||||
pNode->peerInfo[i]->numOfRetrieves = 0;
|
pNode->peerInfo[i]->numOfRetrieves = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
(*pNode->notifyFlowCtrl)(pNode->ahandle, 0);
|
if (pNode->notifyFlowCtrl)
|
||||||
|
(*pNode->notifyFlowCtrl)(pNode->ahandle, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void syncChooseMaster(SSyncNode *pNode) {
|
static void syncChooseMaster(SSyncNode *pNode) {
|
||||||
|
|
|
@ -477,11 +477,12 @@ void *syncRetrieveData(void *param)
|
||||||
if (pPeer->fileChanged) {
|
if (pPeer->fileChanged) {
|
||||||
// if file is changed 3 times continuously, start flow control
|
// if file is changed 3 times continuously, start flow control
|
||||||
pPeer->numOfRetrieves++;
|
pPeer->numOfRetrieves++;
|
||||||
if (pPeer->numOfRetrieves >= 3)
|
if (pPeer->numOfRetrieves >= 3 && pNode->notifyFlowCtrl)
|
||||||
(*pNode->notifyFlowCtrl)(pNode->ahandle, pPeer->numOfRetrieves - 2);
|
(*pNode->notifyFlowCtrl)(pNode->ahandle, pPeer->numOfRetrieves - 2);
|
||||||
} else {
|
} else {
|
||||||
pPeer->numOfRetrieves = 0;
|
pPeer->numOfRetrieves = 0;
|
||||||
(*pNode->notifyFlowCtrl)(pNode->ahandle, 0);
|
if (pNode->notifyFlowCtrl)
|
||||||
|
(*pNode->notifyFlowCtrl)(pNode->ahandle, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
pPeer->fileChanged = 0;
|
pPeer->fileChanged = 0;
|
||||||
|
|
Loading…
Reference in New Issue