diff options
| author | Gordon Sim <gsim@apache.org> | 2009-06-11 01:59:16 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2009-06-11 01:59:16 +0000 |
| commit | e56eb99870b95e5f0a610ac950a629e45e51fb6d (patch) | |
| tree | 7df1a89850d3661d163b674a38b906d5df00fd2f /qpid/cpp | |
| parent | 9b3c6b3aa2666271cc4615df3dd6c60e90e58ed2 (diff) | |
| download | qpid-python-e56eb99870b95e5f0a610ac950a629e45e51fb6d.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@783599 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
| -rw-r--r-- | qpid/cpp/src/qpid/client/SessionImpl.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
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<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; } |
