diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/amqp_0_10/Connection.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cpp/src/qpid/amqp_0_10/Connection.cpp b/cpp/src/qpid/amqp_0_10/Connection.cpp index 22a37b7115..ceeaadf70c 100644 --- a/cpp/src/qpid/amqp_0_10/Connection.cpp +++ b/cpp/src/qpid/amqp_0_10/Connection.cpp @@ -95,7 +95,12 @@ size_t Connection::encode(const char* buffer, size_t size) { QPID_LOG(trace, "SENT [" << identifier << "]: " << workQueue.front()); workQueue.pop_front(); encoded += frameSize; - if (workQueue.empty() && out.available() > 0) connection->doOutput(); + if (workQueue.empty() && out.available() > 0) { + // try to get more output + connection->doOutput(); + Mutex::ScopedLock l(frameQueueLock); + workQueue.swap(frameQueue); // Need to get any new frames into the work queue + } } assert(workQueue.empty() || workQueue.front().encodedSize() <= size); if (!workQueue.empty() && workQueue.front().encodedSize() > size) |