summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/framing
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-10-02 10:36:28 +0000
committerGordon Sim <gsim@apache.org>2007-10-02 10:36:28 +0000
commit5254308738c9b7df64563811ae153cbae3de5f06 (patch)
tree537556801d66e5ed23b23ecab6849245ad3cb99b /cpp/src/qpid/framing
parent61ec67bde802657ef173482e4409685bcc61a3f9 (diff)
downloadqpid-python-5254308738c9b7df64563811ae153cbae3de5f06.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/qpid@581185 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/framing')
-rw-r--r--cpp/src/qpid/framing/frame_functors.h17
1 files changed, 17 insertions, 0 deletions
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<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;