From e56eb99870b95e5f0a610ac950a629e45e51fb6d Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Thu, 11 Jun 2009 01:59:16 +0000 Subject: 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@783599 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/client/SessionImpl.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'qpid/cpp/src') diff --git a/qpid/cpp/src/qpid/client/SessionImpl.cpp b/qpid/cpp/src/qpid/client/SessionImpl.cpp index 9fa9bc644c..1623690f3d 100644 --- a/qpid/cpp/src/qpid/client/SessionImpl.cpp +++ b/qpid/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(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; } -- cgit v1.2.1