diff options
author | Christian Kandeler <[email protected]> | 2012-06-06 15:16:03 +0200 |
---|---|---|
committer | Daniel Molkentin <[email protected]> | 2012-06-06 15:39:25 +0200 |
commit | 3e809de1cf2c9e5f2e84c7021b76c9b1b9e75671 (patch) | |
tree | f8dfc68e0d65f1695e5badf59e7912e7863ef547 /src/libs/ssh/sshchannel.cpp | |
parent | cc352594310789528ded9afdb0b9e1e6fa319c5c (diff) |
SSH: Fix send buffer flushing.
There might be more data to send than what fits into one packet. This
case was not handled correctly.
Change-Id: I5a415223c37ec8a041503d901bbcc81e903f46d9
Reviewed-by: Daniel Molkentin <[email protected]>
Diffstat (limited to 'src/libs/ssh/sshchannel.cpp')
-rw-r--r-- | src/libs/ssh/sshchannel.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libs/ssh/sshchannel.cpp b/src/libs/ssh/sshchannel.cpp index 0d8fbfbaaec..60164f44077 100644 --- a/src/libs/ssh/sshchannel.cpp +++ b/src/libs/ssh/sshchannel.cpp @@ -116,9 +116,11 @@ void AbstractSshChannel::handleWindowAdjust(quint32 bytesToAdd) void AbstractSshChannel::flushSendBuffer() { - const quint32 bytesToSend = qMin(m_remoteMaxPacketSize, - qMin<quint32>(m_remoteWindowSize, m_sendBuffer.size())); - if (bytesToSend > 0) { + while (true) { + const quint32 bytesToSend = qMin(m_remoteMaxPacketSize, + qMin<quint32>(m_remoteWindowSize, m_sendBuffer.size())); + if (bytesToSend == 0) + break; const QByteArray &data = m_sendBuffer.left(bytesToSend); m_sendFacility.sendChannelDataPacket(m_remoteChannel, data); m_sendBuffer.remove(0, bytesToSend); |