From f7278c1d02b64511759ad0f87ab9b78d5eca2004 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Mon, 26 Jan 2009 18:59:58 +0000 Subject: QPID-1567: Fixed replicating event listener to properly clone headers of original message so as to avoid conuccrently modifyig them while the original message is being delivered. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@737779 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/replication/ReplicatingEventListener.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'cpp/src') diff --git a/cpp/src/qpid/replication/ReplicatingEventListener.cpp b/cpp/src/qpid/replication/ReplicatingEventListener.cpp index 52634e5640..2d8af3b052 100644 --- a/cpp/src/qpid/replication/ReplicatingEventListener.cpp +++ b/cpp/src/qpid/replication/ReplicatingEventListener.cpp @@ -108,7 +108,16 @@ boost::intrusive_ptr ReplicatingEventListener::cloneMessage(Queue& queu AMQFrame method((MessageTransferBody(ProtocolVersion(), EMPTY, 0, 0))); AppendingHandler handler(copy); handler.handle(method); - original->sendHeader(handler, std::numeric_limits::max()); + + //To avoid modifying original headers, create new frame with + //cloned body: + AMQFrame header(*original->getFrames().getHeaders()); + header.setBof(false); + header.setEof(!original->getFrames().getContentSize());//if there is any content then the header is not the end of the frameset + header.setBos(true); + header.setEos(true); + handler.handle(header); + original->sendContent(queue, handler, std::numeric_limits::max()); return copy; } -- cgit v1.2.1