summaryrefslogtreecommitdiff
path: root/storage/ndb/src/common/transporter
diff options
context:
space:
mode:
authorunknown <jonas@perch.ndb.mysql.com>2008-01-23 13:10:09 +0100
committerunknown <jonas@perch.ndb.mysql.com>2008-01-23 13:10:09 +0100
commit78ac242f2bae276bf9cb72617e70d7ca7b9e829f (patch)
tree05761a7fdfa88ab042e3f6ba676d9c74c5b44a15 /storage/ndb/src/common/transporter
parentbd70a104d92f7e7715b7cb776b752f4027ff5f4b (diff)
parente2ba0ab94cd5f8c788e5b363f75cea4408e1725c (diff)
downloadmariadb-git-78ac242f2bae276bf9cb72617e70d7ca7b9e829f.tar.gz
Merge perch.ndb.mysql.com:/home/jonas/src/51-telco-gca
into perch.ndb.mysql.com:/home/jonas/src/51-ndb storage/ndb/src/common/transporter/TCP_Transporter.cpp: Auto merged
Diffstat (limited to 'storage/ndb/src/common/transporter')
-rw-r--r--storage/ndb/src/common/transporter/TCP_Transporter.cpp22
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 "