提交 be58861a 编写于 作者: 陶建辉(Jeff)'s avatar 陶建辉(Jeff)

function pointer may be null

上级 c9bcfe5f
...@@ -537,7 +537,8 @@ static void syncResetFlowCtrl(SSyncNode *pNode) { ...@@ -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) ...@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册