Do not call CloseSocketDisconnect from non-socket handler threads (#1276)

This commit is contained in:
Tim Flynn 2017-01-19 14:02:57 -05:00 committed by UdjinM6
parent 4b7bd6be8f
commit 0233d87739

View File

@ -788,7 +788,7 @@ void SocketSendData(CNode *pnode)
if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS) if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS)
{ {
LogPrintf("socket send error %s\n", NetworkErrorString(nErr)); LogPrintf("socket send error %s\n", NetworkErrorString(nErr));
pnode->CloseSocketDisconnect(); pnode->fDisconnect = true;
} }
} }
// couldn't send anything at all // couldn't send anything at all
@ -1749,7 +1749,7 @@ void ThreadMessageHandler()
if (lockRecv) if (lockRecv)
{ {
if (!g_signals.ProcessMessages(pnode)) if (!g_signals.ProcessMessages(pnode))
pnode->CloseSocketDisconnect(); pnode->fDisconnect = true;
if (pnode->nSendSize < SendBufferSize()) if (pnode->nSendSize < SendBufferSize())
{ {