diff options
author | Gordon Sim <gsim@apache.org> | 2007-10-02 10:36:28 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2007-10-02 10:36:28 +0000 |
commit | 20afd0e67c8df4c2eadcf2a9fdfdc8e0fdefac75 (patch) | |
tree | 3fcca8cbd763478c7fc44e22a6ec49155c06ddbf /qpid/cpp/src/qpid/framing/frame_functors.h | |
parent | 943be55754cfc22c3d3b164b92b30b062d383484 (diff) | |
download | qpid-python-20afd0e67c8df4c2eadcf2a9fdfdc8e0fdefac75.tar.gz |
Fixed bug introduced in r577027 where the header frame of a message is directly passed to output handler where the channel is changed. This causing problems when the message is sent to multiple channels concurrently. I've added a const modifier to preventthe message being altered by sendHeader().
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@581185 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qpid/framing/frame_functors.h')
-rw-r--r-- | qpid/cpp/src/qpid/framing/frame_functors.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/qpid/cpp/src/qpid/framing/frame_functors.h b/qpid/cpp/src/qpid/framing/frame_functors.h index ed664d1529..d5b1321d72 100644 --- a/qpid/cpp/src/qpid/framing/frame_functors.h +++ b/qpid/cpp/src/qpid/framing/frame_functors.h @@ -82,6 +82,23 @@ public: void operator()(const AMQFrame& f) { content += f.castBody<AMQContentBody>()->getData(); } }; +/** + * Sends a copy of the frame its applied to to the specified handler + */ +class Relay +{ + FrameHandler& handler; + +public: + Relay(FrameHandler& h) : handler(h) {} + + void operator()(const AMQFrame& f) + { + AMQFrame copy(f); + handler.handle(copy); + } +}; + class Print { std::ostream& out; |