summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2009-01-26 18:59:58 +0000
committerGordon Sim <gsim@apache.org>2009-01-26 18:59:58 +0000
commitf7278c1d02b64511759ad0f87ab9b78d5eca2004 (patch)
tree01661ab2d4863d0f537fbb73001f45f6a4632e9f /cpp/src
parente7f0f3ade6bd178703b2f87454a94d2c7f3b62f8 (diff)
downloadqpid-python-f7278c1d02b64511759ad0f87ab9b78d5eca2004.tar.gz
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
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/replication/ReplicatingEventListener.cpp11
1 files changed, 10 insertions, 1 deletions
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<Message> ReplicatingEventListener::cloneMessage(Queue& queu
AMQFrame method((MessageTransferBody(ProtocolVersion(), EMPTY, 0, 0)));
AppendingHandler handler(copy);
handler.handle(method);
- original->sendHeader(handler, std::numeric_limits<int16_t>::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<int16_t>::max());
return copy;
}