[net] Move RecordBytesSent() call out of cs_vSend lock

pull/826/head
John Newbery 4 years ago
parent 02cf20b9f5
commit 673254515a

@ -1512,16 +1512,10 @@ void CConnman::SocketHandler()
}
}
//
// Send
//
if (sendSet)
{
LOCK(pnode->cs_vSend);
size_t nBytes = SocketSendData(pnode);
if (nBytes) {
RecordBytesSent(nBytes);
}
if (sendSet) {
// Send data
size_t bytes_sent = WITH_LOCK(pnode->cs_vSend, return SocketSendData(pnode));
if (bytes_sent) RecordBytesSent(bytes_sent);
}
InactivityCheck(pnode);

Loading…
Cancel
Save