Changeset View
Changeset View
Standalone View
Standalone View
src/net.cpp
Show First 20 Lines • Show All 576 Lines • ▼ Show 20 Lines | bool CNode::ReceiveMsgBytes(const Config &config, const char *pch, | ||||
LOCK(cs_vRecv); | LOCK(cs_vRecv); | ||||
nLastRecv = nTimeMicros / 1000000; | nLastRecv = nTimeMicros / 1000000; | ||||
nRecvBytes += nBytes; | nRecvBytes += nBytes; | ||||
while (nBytes > 0) { | while (nBytes > 0) { | ||||
// Absorb network data. | // Absorb network data. | ||||
int handled = m_deserializer->Read(config, pch, nBytes); | int handled = m_deserializer->Read(config, pch, nBytes); | ||||
if (handled < 0) { | if (handled < 0) { | ||||
m_deserializer->Reset(); | |||||
return false; | return false; | ||||
} | } | ||||
pch += handled; | pch += handled; | ||||
nBytes -= handled; | nBytes -= handled; | ||||
if (m_deserializer->Complete()) { | if (m_deserializer->Complete()) { | ||||
// decompose a transport agnostic CNetMessage from the deserializer | // decompose a transport agnostic CNetMessage from the deserializer | ||||
▲ Show 20 Lines • Show All 2,478 Lines • Show Last 20 Lines |