From 5254308738c9b7df64563811ae153cbae3de5f06 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Tue, 2 Oct 2007 10:36:28 +0000 Subject: 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/qpid@581185 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/framing/frame_functors.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'cpp/src/qpid/framing') diff --git a/cpp/src/qpid/framing/frame_functors.h b/cpp/src/qpid/framing/frame_functors.h index ed664d1529..d5b1321d72 100644 --- a/cpp/src/qpid/framing/frame_functors.h +++ b/cpp/src/qpid/framing/frame_functors.h @@ -82,6 +82,23 @@ public: void operator()(const AMQFrame& f) { content += f.castBody()->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; -- cgit v1.2.1