mirror of
https://github.com/MariaDB/server.git
synced 2026-05-02 13:15:32 +02:00
ndb - bug#34005
make sure whole send buffer is flushed, even when wrapping around end
ndb/src/common/transporter/TCP_Transporter.cpp:
ndb - bug#34005
make sure whole send buffer is flush, even when wrapping around end
This commit is contained in:
parent
a79ebb8503
commit
ac632f5cbb
1 changed files with 16 additions and 6 deletions
|
|
@ -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 "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue