mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-11 03:53:22 +02:00
scripted-diff: rename CNode::cs_hSocket to CNode::m_sock_mutex
-BEGIN VERIFY SCRIPT- sed -i -e 's/cs_hSocket/m_sock_mutex/g' $(git grep -l cs_hSocket) -END VERIFY SCRIPT-
This commit is contained in:
10
src/net.cpp
10
src/net.cpp
@@ -517,7 +517,7 @@ CNode* CConnman::ConnectNode(CAddress addrConnect, const char *pszDest, bool fCo
|
|||||||
void CNode::CloseSocketDisconnect()
|
void CNode::CloseSocketDisconnect()
|
||||||
{
|
{
|
||||||
fDisconnect = true;
|
fDisconnect = true;
|
||||||
LOCK(cs_hSocket);
|
LOCK(m_sock_mutex);
|
||||||
if (m_sock) {
|
if (m_sock) {
|
||||||
LogPrint(BCLog::NET, "disconnecting peer=%d\n", id);
|
LogPrint(BCLog::NET, "disconnecting peer=%d\n", id);
|
||||||
m_sock.reset();
|
m_sock.reset();
|
||||||
@@ -798,7 +798,7 @@ size_t CConnman::SocketSendData(CNode& node) const
|
|||||||
assert(data.size() > node.nSendOffset);
|
assert(data.size() > node.nSendOffset);
|
||||||
int nBytes = 0;
|
int nBytes = 0;
|
||||||
{
|
{
|
||||||
LOCK(node.cs_hSocket);
|
LOCK(node.m_sock_mutex);
|
||||||
if (!node.m_sock) {
|
if (!node.m_sock) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1381,7 +1381,7 @@ bool CConnman::GenerateSelectSet(const std::vector<CNode*>& nodes,
|
|||||||
select_send = !pnode->vSendMsg.empty();
|
select_send = !pnode->vSendMsg.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCK(pnode->cs_hSocket);
|
LOCK(pnode->m_sock_mutex);
|
||||||
if (!pnode->m_sock) {
|
if (!pnode->m_sock) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1562,7 +1562,7 @@ void CConnman::SocketHandlerConnected(const std::vector<CNode*>& nodes,
|
|||||||
bool sendSet = false;
|
bool sendSet = false;
|
||||||
bool errorSet = false;
|
bool errorSet = false;
|
||||||
{
|
{
|
||||||
LOCK(pnode->cs_hSocket);
|
LOCK(pnode->m_sock_mutex);
|
||||||
if (!pnode->m_sock) {
|
if (!pnode->m_sock) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1576,7 +1576,7 @@ void CConnman::SocketHandlerConnected(const std::vector<CNode*>& nodes,
|
|||||||
uint8_t pchBuf[0x10000];
|
uint8_t pchBuf[0x10000];
|
||||||
int nBytes = 0;
|
int nBytes = 0;
|
||||||
{
|
{
|
||||||
LOCK(pnode->cs_hSocket);
|
LOCK(pnode->m_sock_mutex);
|
||||||
if (!pnode->m_sock) {
|
if (!pnode->m_sock) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@@ -411,7 +411,7 @@ public:
|
|||||||
* poll(2)-ing it for activity.
|
* poll(2)-ing it for activity.
|
||||||
* @see https://github.com/bitcoin/bitcoin/issues/21744 for details.
|
* @see https://github.com/bitcoin/bitcoin/issues/21744 for details.
|
||||||
*/
|
*/
|
||||||
std::shared_ptr<Sock> m_sock GUARDED_BY(cs_hSocket);
|
std::shared_ptr<Sock> m_sock GUARDED_BY(m_sock_mutex);
|
||||||
|
|
||||||
/** Total size of all vSendMsg entries */
|
/** Total size of all vSendMsg entries */
|
||||||
size_t nSendSize GUARDED_BY(cs_vSend){0};
|
size_t nSendSize GUARDED_BY(cs_vSend){0};
|
||||||
@@ -420,7 +420,7 @@ public:
|
|||||||
uint64_t nSendBytes GUARDED_BY(cs_vSend){0};
|
uint64_t nSendBytes GUARDED_BY(cs_vSend){0};
|
||||||
std::deque<std::vector<unsigned char>> vSendMsg GUARDED_BY(cs_vSend);
|
std::deque<std::vector<unsigned char>> vSendMsg GUARDED_BY(cs_vSend);
|
||||||
Mutex cs_vSend;
|
Mutex cs_vSend;
|
||||||
Mutex cs_hSocket;
|
Mutex m_sock_mutex;
|
||||||
Mutex cs_vRecv;
|
Mutex cs_vRecv;
|
||||||
|
|
||||||
RecursiveMutex cs_vProcessMsg;
|
RecursiveMutex cs_vProcessMsg;
|
||||||
|
Reference in New Issue
Block a user