diff options
author | Gordon Sim <gsim@apache.org> | 2008-04-07 11:51:07 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2008-04-07 11:51:07 +0000 |
commit | b1200b51f070c5b1c0f8d2683af815fe80df9d1c (patch) | |
tree | 2f10f9b4d90bcfc398bb0d48a738b23572df7f25 /cpp/src/qpid/broker/PreviewConnectionCodec.cpp | |
parent | 4734b4f16482e331f3c5008f66ffd87fa7a79bea (diff) | |
download | qpid-python-b1200b51f070c5b1c0f8d2683af815fe80df9d1c.tar.gz |
AsynchIoAcceptor.cpp: Limit output from codec to one buffer per 'idle' call.
PreviewConnectionCodec: Generate output frames for encoding while available and while they can fit in the buffer given
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@645470 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/PreviewConnectionCodec.cpp')
-rw-r--r-- | cpp/src/qpid/broker/PreviewConnectionCodec.cpp | 3 |
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.")); |