summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/PreviewConnectionCodec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/broker/PreviewConnectionCodec.cpp')
-rw-r--r--cpp/src/qpid/broker/PreviewConnectionCodec.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/PreviewConnectionCodec.cpp b/cpp/src/qpid/broker/PreviewConnectionCodec.cpp
index d3a5281109..b6c9b03776 100644
--- a/cpp/src/qpid/broker/PreviewConnectionCodec.cpp
+++ b/cpp/src/qpid/broker/PreviewConnectionCodec.cpp
@@ -40,7 +40,7 @@ size_t PreviewConnectionCodec::decode(const char* buffer, size_t size) {
}
bool PreviewConnectionCodec::canEncode() {
- if (!frameQueueClosed) connection.doOutput();
+ if (!frameQueueClosed && frameQueue.empty()) connection.doOutput();
return !frameQueue.empty();
}
@@ -56,6 +56,7 @@ size_t PreviewConnectionCodec::encode(const char* buffer, size_t size) {
frameQueue.front().encode(out);
QPID_LOG(trace, "SENT [" << identifier << "]: " << frameQueue.front());
frameQueue.pop();
+ if (!frameQueueClosed && frameQueue.empty()) connection.doOutput();
}
if (!frameQueue.empty() && frameQueue.front().size() > size)
throw framing::ContentTooLargeException(QPID_MSG("Could not write frame, too large for buffer."));