Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13115621
D8223.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D8223.diff
View Options
diff --git a/src/net.h b/src/net.h
--- a/src/net.h
+++ b/src/net.h
@@ -664,6 +664,8 @@
bool m_valid_checksum = false;
// size of the payload
uint32_t m_message_size = 0;
+ // used wire size of the message (including header/checksum)
+ uint32_t m_raw_message_size = 0;
std::string m_command;
CNetMessage(const CDataStream &recv_in) : m_recv(std::move(recv_in)) {}
diff --git a/src/net.cpp b/src/net.cpp
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -625,8 +625,7 @@
}
assert(i != mapRecvBytesPerMsgCmd.end());
- i->second +=
- m_deserializer->hdr.nMessageSize + CMessageHeader::HEADER_SIZE;
+ i->second += msg.m_raw_message_size;
// push the message to the process queue,
vRecvMsg.push_back(std::move(msg));
@@ -740,6 +739,7 @@
// store command string, payload size
msg.m_command = hdr.GetCommand();
msg.m_message_size = hdr.nMessageSize;
+ msg.m_raw_message_size = hdr.nMessageSize + CMessageHeader::HEADER_SIZE;
msg.m_valid_checksum = (memcmp(hash.begin(), hdr.pchChecksum,
CMessageHeader::CHECKSUM_SIZE) == 0);
@@ -1522,8 +1522,7 @@
// vRecvMsg contains only completed CNetMessage
// the single possible partially deserialized message
// are held by TransportDeserializer
- nSizeAdded +=
- it->m_recv.size() + CMessageHeader::HEADER_SIZE;
+ nSizeAdded += it->m_raw_message_size;
}
{
LOCK(pnode->cs_vProcessMsg);
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -3969,8 +3969,7 @@
// Just take one message
msgs.splice(msgs.begin(), pfrom->vProcessMsg,
pfrom->vProcessMsg.begin());
- pfrom->nProcessQueueSize -=
- msgs.front().m_recv.size() + CMessageHeader::HEADER_SIZE;
+ pfrom->nProcessQueueSize -= msgs.front().m_raw_message_size;
pfrom->fPauseRecv =
pfrom->nProcessQueueSize > connman->GetReceiveFloodSize();
fMoreWork = !pfrom->vProcessMsg.empty();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 1, 11:34 (3 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187634
Default Alt Text
D8223.diff (2 KB)
Attached To
D8223: Remove transport protocol knowhow from CNetMessage / net processing
Event Timeline
Log In to Comment