diff options
| author | Gordon Sim <gsim@apache.org> | 2008-09-23 18:35:52 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2008-09-23 18:35:52 +0000 |
| commit | 574c338d3731043fd598040ccba211e2e339d977 (patch) | |
| tree | 2e3453843be5080e5e4a96fc5ceabb94c15d1aec /qpid/cpp/src | |
| parent | 0e9ac83e4bca2c67c8899b6e1a3717e4320c5d4f (diff) | |
| download | qpid-python-574c338d3731043fd598040ccba211e2e339d977.tar.gz | |
Batch writing of outgoing messages (up to one buffers worth)
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@698272 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
| -rw-r--r-- | qpid/cpp/src/qpid/amqp_0_10/Connection.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/qpid/cpp/src/qpid/amqp_0_10/Connection.cpp b/qpid/cpp/src/qpid/amqp_0_10/Connection.cpp index 6e0566c3c1..9b8b7d93c7 100644 --- a/qpid/cpp/src/qpid/amqp_0_10/Connection.cpp +++ b/qpid/cpp/src/qpid/amqp_0_10/Connection.cpp @@ -79,10 +79,11 @@ size_t Connection::encode(const char* buffer, size_t size) { } size_t frameSize=0; while (!frameQueue.empty() && ((frameSize=frameQueue.front().size()) <= out.available())) { - frameQueue.front().encode(out); - QPID_LOG(trace, "SENT [" << identifier << "]: " << frameQueue.front()); - frameQueue.pop_front(); - buffered -= frameSize; + frameQueue.front().encode(out); + QPID_LOG(trace, "SENT [" << identifier << "]: " << frameQueue.front()); + frameQueue.pop_front(); + buffered -= frameSize; + if (frameQueue.empty() && out.available() > 0) connection->doOutput(); } assert(frameQueue.empty() || frameQueue.front().size() <= size); if (!frameQueue.empty() && frameQueue.front().size() > size) |
