summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
authorjonas@perch.ndb.mysql.com <>2008-01-23 12:56:27 +0100
committerjonas@perch.ndb.mysql.com <>2008-01-23 12:56:27 +0100
commit68b5382a60b15821431f1516156e6a1d15c2b3b3 (patch)
tree0208d6bc857a2ff07ddb796b637add1d58358e13 /ndb
parent88dc7e9d7602be1adc1796d7bd1406c5f95aff16 (diff)
downloadmariadb-git-68b5382a60b15821431f1516156e6a1d15c2b3b3.tar.gz
ndb - bug#34005
make sure whole send buffer is flushed, even when wrapping around end
Diffstat (limited to 'ndb')
-rw-r--r--ndb/src/common/transporter/TCP_Transporter.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/ndb/src/common/transporter/TCP_Transporter.cpp b/ndb/src/common/transporter/TCP_Transporter.cpp
index 91a5fb50c57..8e09c9d90c8 100644
--- a/ndb/src/common/transporter/TCP_Transporter.cpp
+++ b/ndb/src/common/transporter/TCP_Transporter.cpp
@@ -330,22 +330,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 = inet_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
ndbout_c("Send Failure(disconnect==%d) to node = %d nBytesSent = %d "