diff options
author | Gordon Sim <gsim@apache.org> | 2009-01-26 18:59:58 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2009-01-26 18:59:58 +0000 |
commit | 354b1cc23f9c11a4eecd37b8327e8502a0d23865 (patch) | |
tree | f1f90b08908667110d1aa028877423534d1cec86 | |
parent | 7cbfd08c69c0ff2ce882e38c890add105f8fce0c (diff) | |
download | qpid-python-354b1cc23f9c11a4eecd37b8327e8502a0d23865.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@737779 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/cpp/src/qpid/replication/ReplicatingEventListener.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/replication/ReplicatingEventListener.cpp b/qpid/cpp/src/qpid/replication/ReplicatingEventListener.cpp index 52634e5640..2d8af3b052 100644 --- a/qpid/cpp/src/qpid/replication/ReplicatingEventListener.cpp +++ b/qpid/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; } |