summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/SessionImpl.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2009-06-11 01:59:16 +0000
committerGordon Sim <gsim@apache.org>2009-06-11 01:59:16 +0000
commitc40597ee3a09fb8e4e75ea165fe04cf8b5d7cce5 (patch)
tree100ec62c36b9ddd6d49bd0de7d51b3d0a003a0c0 /cpp/src/qpid/client/SessionImpl.cpp
parent744419de525013ad24b0034b4c048c6563624bf8 (diff)
downloadqpid-python-c40597ee3a09fb8e4e75ea165fe04cf8b5d7cce5.tar.gz
If frameset being sent in cluster update is incomplete (i.e. content has been released) then send frames as is (will just be header).
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@783599 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/SessionImpl.cpp')
-rw-r--r--cpp/src/qpid/client/SessionImpl.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/cpp/src/qpid/client/SessionImpl.cpp b/cpp/src/qpid/client/SessionImpl.cpp
index 9fa9bc644c..1623690f3d 100644
--- a/cpp/src/qpid/client/SessionImpl.cpp
+++ b/cpp/src/qpid/client/SessionImpl.cpp
@@ -289,6 +289,16 @@ Future SessionImpl::send(const AMQBody& command, const MethodContent& content)
}
namespace {
+// Functor for FrameSet::map to send header + content frames but, not method frames.
+struct SendContentFn {
+ FrameHandler& handler;
+ void operator()(const AMQFrame& f) {
+ if (!f.getMethod())
+ handler(const_cast<AMQFrame&>(f));
+ }
+ SendContentFn(FrameHandler& h) : handler(h) {}
+};
+
// Adaptor to make FrameSet look like MethodContent; used in cluster update client
struct MethodContentAdaptor : MethodContent
{
@@ -327,8 +337,13 @@ Future SessionImpl::send(const AMQBody& command, const FrameSet& content) {
frame.setEof(false);
handleOut(frame);
- MethodContentAdaptor c(content);
- sendContent(c);
+ if (content.isComplete()) {
+ MethodContentAdaptor c(content);
+ sendContent(c);
+ } else {
+ SendContentFn send(out);
+ content.map(send);
+ }
return f;
}