mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 15:50:07 +01:00
process received messages one at a time without sleeping between messages
This commit is contained in:
committed by
Wladimir J. van der Laan
parent
ef14a26b12
commit
7084756f4f
@@ -3141,6 +3141,9 @@ void static ProcessGetData(CNode* pfrom)
|
||||
|
||||
// Track requests for our stuff.
|
||||
Inventory(inv.hash);
|
||||
|
||||
if (inv.type == MSG_BLOCK || inv.type == MSG_FILTERED_BLOCK)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3751,6 +3754,9 @@ bool ProcessMessages(CNode* pfrom)
|
||||
if (!pfrom->vRecvGetData.empty())
|
||||
ProcessGetData(pfrom);
|
||||
|
||||
// this maintains the order of responses
|
||||
if (!pfrom->vRecvGetData.empty()) return fOk;
|
||||
|
||||
std::deque<CNetMessage>::iterator it = pfrom->vRecvMsg.begin();
|
||||
while (!pfrom->fDisconnect && it != pfrom->vRecvMsg.end()) {
|
||||
// Don't bother if send buffer is too full to respond anyway
|
||||
@@ -3841,6 +3847,8 @@ bool ProcessMessages(CNode* pfrom)
|
||||
|
||||
if (!fRet)
|
||||
printf("ProcessMessage(%s, %u bytes) FAILED\n", strCommand.c_str(), nMessageSize);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// In case the connection got shut down, its receive buffer was wiped
|
||||
|
||||
Reference in New Issue
Block a user