summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2012-04-18 14:10:26 +0000
committerGordon Sim <gsim@apache.org>2012-04-18 14:10:26 +0000
commitedd6a852ef6d04821e034af27e6c5ddc0e92bbfd (patch)
tree9cd2657cb39f231c4683440596999f1172333840
parent9313a517b670b91e39f045b784fdb986083950e1 (diff)
downloadqpid-python-edd6a852ef6d04821e034af27e6c5ddc0e92bbfd.tar.gz
QPID-3958: Prevent malformed frameset being set when replicating a message with an empty content frame
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1327515 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/qpid/framing/FrameSet.cpp4
-rw-r--r--qpid/cpp/src/qpid/framing/FrameSet.h1
-rw-r--r--qpid/cpp/src/qpid/replication/ReplicatingEventListener.cpp2
3 files changed, 6 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/framing/FrameSet.cpp b/qpid/cpp/src/qpid/framing/FrameSet.cpp
index d2612e484f..9aee7b98b9 100644
--- a/qpid/cpp/src/qpid/framing/FrameSet.cpp
+++ b/qpid/cpp/src/qpid/framing/FrameSet.cpp
@@ -102,3 +102,7 @@ std::string FrameSet::getContent() const {
getContent(out);
return out;
}
+
+bool FrameSet::hasContent() const {
+ return parts.size() >= 3;
+}
diff --git a/qpid/cpp/src/qpid/framing/FrameSet.h b/qpid/cpp/src/qpid/framing/FrameSet.h
index cae75e5ec8..f11bdb938b 100644
--- a/qpid/cpp/src/qpid/framing/FrameSet.h
+++ b/qpid/cpp/src/qpid/framing/FrameSet.h
@@ -54,6 +54,7 @@ public:
QPID_COMMON_EXTERN void getContent(std::string&) const;
QPID_COMMON_EXTERN std::string getContent() const;
+ bool hasContent() const;
bool isContentBearing() const;
diff --git a/qpid/cpp/src/qpid/replication/ReplicatingEventListener.cpp b/qpid/cpp/src/qpid/replication/ReplicatingEventListener.cpp
index 3d84a1ce3c..9284bda388 100644
--- a/qpid/cpp/src/qpid/replication/ReplicatingEventListener.cpp
+++ b/qpid/cpp/src/qpid/replication/ReplicatingEventListener.cpp
@@ -131,7 +131,7 @@ boost::intrusive_ptr<Message> ReplicatingEventListener::cloneMessage(Queue& queu
//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.setEof(!original->getFrames().hasContent());//if there are any content frames then the header is not the end of the frameset
header.setBos(true);
header.setEos(true);
handler.handle(header);