diff options
author | jonas@perch.ndb.mysql.com <> | 2008-01-23 13:10:09 +0100 |
---|---|---|
committer | jonas@perch.ndb.mysql.com <> | 2008-01-23 13:10:09 +0100 |
commit | 79e8f3e40656fbcd108fbe3e35300e1bec4b6603 (patch) | |
tree | 05761a7fdfa88ab042e3f6ba676d9c74c5b44a15 | |
parent | 47f379d2f174b6843d45bcf751bddb056e74e5f5 (diff) | |
parent | 664cc992fa62c0dc4928a95190c6e85159ff2274 (diff) | |
download | mariadb-git-79e8f3e40656fbcd108fbe3e35300e1bec4b6603.tar.gz |
Merge perch.ndb.mysql.com:/home/jonas/src/51-telco-gca
into perch.ndb.mysql.com:/home/jonas/src/51-ndb
-rw-r--r-- | storage/ndb/src/common/transporter/TCP_Transporter.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/storage/ndb/src/common/transporter/TCP_Transporter.cpp b/storage/ndb/src/common/transporter/TCP_Transporter.cpp index 298e43710b0..8b386483bff 100644 --- a/storage/ndb/src/common/transporter/TCP_Transporter.cpp +++ b/storage/ndb/src/common/transporter/TCP_Transporter.cpp @@ -317,22 +317,32 @@ TCP_Transporter::doSend() { // Empty the SendBuffers - const char * const sendPtr = m_sendBuffer.sendPtr; - const Uint32 sizeToSend = m_sendBuffer.sendDataSize; - if (sizeToSend > 0){ + bool sent_any = true; + while (m_sendBuffer.dataSize > 0) + { + const char * const sendPtr = m_sendBuffer.sendPtr; + const Uint32 sizeToSend = m_sendBuffer.sendDataSize; const int nBytesSent = send(theSocket, sendPtr, sizeToSend, 0); - if (nBytesSent > 0) { + if (nBytesSent > 0) + { + sent_any = true; m_sendBuffer.bytesSent(nBytesSent); sendCount ++; sendSize += nBytesSent; - if(sendCount == reportFreq){ + if(sendCount == reportFreq) + { reportSendLen(get_callback_obj(), remoteNodeId, sendCount, sendSize); sendCount = 0; sendSize = 0; } - } else { + } + else + { + if (nBytesSent < 0 && InetErrno == EAGAIN && sent_any) + break; + // Send failed #if defined DEBUG_TRANSPORTER g_eventLogger.error("Send Failure(disconnect==%d) to node = %d nBytesSent = %d " |