Formatting changes
This commit is contained in:
16
src/net.cpp
16
src/net.cpp
@@ -861,13 +861,13 @@ void SocketSendData(CNode *pnode)
|
|||||||
}
|
}
|
||||||
if (nBytes > 0)
|
if (nBytes > 0)
|
||||||
{
|
{
|
||||||
pnode->nLastSend = GetTime();
|
pnode->nLastSend = GetTime();
|
||||||
pnode->nSendBytes += nBytes;
|
pnode->nSendBytes += nBytes;
|
||||||
pnode->nSendOffset += nBytes;
|
pnode->nSendOffset += nBytes;
|
||||||
pnode->RecordBytesSent(nBytes);
|
pnode->RecordBytesSent(nBytes);
|
||||||
if (pnode->nSendOffset == data.size()) {
|
if (pnode->nSendOffset == data.size()) {
|
||||||
pnode->nSendOffset = 0;
|
pnode->nSendOffset = 0;
|
||||||
pnode->nSendSize -= data.size();
|
pnode->nSendSize -= data.size();
|
||||||
it++;
|
it++;
|
||||||
} else {
|
} else {
|
||||||
// could not send full message; stop sending more
|
// could not send full message; stop sending more
|
||||||
@@ -876,23 +876,17 @@ void SocketSendData(CNode *pnode)
|
|||||||
} else {
|
} else {
|
||||||
if (nBytes <= 0) {
|
if (nBytes <= 0) {
|
||||||
// error
|
// error
|
||||||
//
|
|
||||||
if (bIsSSL)
|
if (bIsSSL)
|
||||||
{
|
{
|
||||||
if (nRet != WOLFSSL_ERROR_WANT_READ && nRet != WOLFSSL_ERROR_WANT_WRITE)
|
if (nRet != WOLFSSL_ERROR_WANT_READ && nRet != WOLFSSL_ERROR_WANT_WRITE)
|
||||||
{
|
{
|
||||||
LogPrintf("ERROR: SSL_write %s; closing connection\n", wolfSSL_ERR_error_string(nRet, NULL));
|
LogPrintf("ERROR: SSL_write %s; closing connection\n", wolfSSL_ERR_error_string(nRet, NULL));
|
||||||
pnode->CloseSocketDisconnect();
|
pnode->CloseSocketDisconnect();
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
// preventive measure from exhausting CPU usage
|
// preventive measure from exhausting CPU usage
|
||||||
//
|
|
||||||
MilliSleep(1); // 1 msec
|
MilliSleep(1); // 1 msec
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
if (nRet != WSAEWOULDBLOCK && nRet != WSAEMSGSIZE && nRet != WSAEINTR && nRet != WSAEINPROGRESS)
|
if (nRet != WSAEWOULDBLOCK && nRet != WSAEMSGSIZE && nRet != WSAEINTR && nRet != WSAEINPROGRESS)
|
||||||
{
|
{
|
||||||
LogPrintf("ERROR: send %s; closing connection\n", NetworkErrorString(nRet));
|
LogPrintf("ERROR: send %s; closing connection\n", NetworkErrorString(nRet));
|
||||||
|
|||||||
Reference in New Issue
Block a user