summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
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;
}