diff options
| author | Gordon Sim <gsim@apache.org> | 2009-06-10 23:38:18 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2009-06-10 23:38:18 +0000 |
| commit | 9b3c6b3aa2666271cc4615df3dd6c60e90e58ed2 (patch) | |
| tree | 98f5728c3ee5e9cd5aced91b2b33085c651833c2 /qpid/cpp | |
| parent | 5bd807fae9375ab248938c96475e6c4e5d7a59b1 (diff) | |
| download | qpid-python-9b3c6b3aa2666271cc4615df3dd6c60e90e58ed2.tar.gz | |
Ensure that messages sent by clusters update client are correctly fragmented based on the max frame size for the session.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@783571 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
| -rw-r--r-- | qpid/cpp/src/qpid/client/SessionImpl.cpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/qpid/cpp/src/qpid/client/SessionImpl.cpp b/qpid/cpp/src/qpid/client/SessionImpl.cpp index 0c6af5d1ff..9fa9bc644c 100644 --- a/qpid/cpp/src/qpid/client/SessionImpl.cpp +++ b/qpid/cpp/src/qpid/client/SessionImpl.cpp @@ -289,15 +289,24 @@ 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 +{ + AMQHeaderBody header; + const std::string content; + + MethodContentAdaptor(const FrameSet& f) : header(*f.getHeaders()), content(f.getContent()) {} + + AMQHeaderBody getHeader() const + { + return header; + } + const std::string& getData() const + { + return content; + } }; + } Future SessionImpl::send(const AMQBody& command, const FrameSet& content) { @@ -318,8 +327,8 @@ Future SessionImpl::send(const AMQBody& command, const FrameSet& content) { frame.setEof(false); handleOut(frame); - SendContentFn send(out); - content.map(send); + MethodContentAdaptor c(content); + sendContent(c); return f; } |
