mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
merge bitcoin#26844: Pass MSG_MORE flag when sending non-final network messages
This commit is contained in:
parent
caaa0fda01
commit
13f6dc1b27
@ -950,7 +950,13 @@ size_t CConnman::SocketSendData(CNode& node)
|
||||
if (!node.m_sock) {
|
||||
break;
|
||||
}
|
||||
nBytes = node.m_sock->Send(reinterpret_cast<const char*>(data.data()) + node.nSendOffset, data.size() - node.nSendOffset, MSG_NOSIGNAL | MSG_DONTWAIT);
|
||||
int flags = MSG_NOSIGNAL | MSG_DONTWAIT;
|
||||
#ifdef MSG_MORE
|
||||
if (it + 1 != node.vSendMsg.end()) {
|
||||
flags |= MSG_MORE;
|
||||
}
|
||||
#endif
|
||||
nBytes = node.m_sock->Send(reinterpret_cast<const char*>(data.data()) + node.nSendOffset, data.size() - node.nSendOffset, flags);
|
||||
}
|
||||
if (nBytes > 0) {
|
||||
node.m_last_send = GetTime<std::chrono::seconds>();
|
||||
|
Loading…
Reference in New Issue
Block a user