diff options
author | Cory Fields <cory-nospam-@coryfields.com> | 2016-12-31 02:05:07 -0500 |
---|---|---|
committer | Cory Fields <cory-nospam-@coryfields.com> | 2017-01-04 09:29:14 -0500 |
commit | e5bcd9c84fd3107321ff6dbdef067ba03f2b43cb (patch) | |
tree | d13ceab3c2c02ea4a22ec8dc10c5f9d92be0808f | |
parent | 53ad9a133a53feb35e31698720cec69c14f56dc1 (diff) |
net: make vRecvMsg a list so that we can use splice()
-rw-r--r-- | src/net.cpp | 2 | ||||
-rw-r--r-- | src/net.h | 2 | ||||
-rw-r--r-- | src/net_processing.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/net.cpp b/src/net.cpp index e7c7cf011c..3478d04a7e 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1859,7 +1859,7 @@ void CConnman::ThreadMessageHandler() if (pnode->nSendSize < GetSendBufferSize()) { - if (!pnode->vRecvGetData.empty() || (!pnode->vRecvMsg.empty() && pnode->vRecvMsg[0].complete())) + if (!pnode->vRecvGetData.empty() || (!pnode->vRecvMsg.empty() && pnode->vRecvMsg.front().complete())) { fSleep = false; } @@ -605,7 +605,7 @@ public: CCriticalSection cs_vSend; std::deque<CInv> vRecvGetData; - std::deque<CNetMessage> vRecvMsg; + std::list<CNetMessage> vRecvMsg; CCriticalSection cs_vRecvMsg; uint64_t nRecvBytes; int nRecvVersion; diff --git a/src/net_processing.cpp b/src/net_processing.cpp index ccfbb77fcd..f53a4b2636 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -2471,7 +2471,7 @@ bool ProcessMessages(CNode* pfrom, CConnman& connman, std::atomic<bool>& interru // this maintains the order of responses if (!pfrom->vRecvGetData.empty()) return fOk; - std::deque<CNetMessage>::iterator it = pfrom->vRecvMsg.begin(); + auto it = pfrom->vRecvMsg.begin(); while (!pfrom->fDisconnect && it != pfrom->vRecvMsg.end()) { // Don't bother if send buffer is too full to respond anyway if (pfrom->nSendSize >= nMaxSendBufferSize) |